mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-25 15:49:08 -05:00
dff28141dc
When file property SWIG_MODULE_NAME is specified, provide option -module to SWIG compiler. Fixes: #18374
12 lines
331 B
CMake
12 lines
331 B
CMake
|
|
cmake_policy(SET CMP0078 NEW)
|
|
|
|
find_package(Python REQUIRED COMPONENTS Development)
|
|
find_package (SWIG REQUIRED)
|
|
include(UseSWIG)
|
|
|
|
set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example")
|
|
|
|
swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i)
|
|
target_link_libraries(example PRIVATE Python::Python)
|