Files
CMake/Tests/RunCMake/UseSWIG/CMP0086-common.cmake
T
Marc Chevrier dff28141dc UseSWIG: add management of SWIG option -module
When file property SWIG_MODULE_NAME is specified, provide option -module
to SWIG compiler.

Fixes: #18374
2018-12-07 18:51:57 +01:00

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)