summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/UseSWIG/CMP0086-common.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-11-27 14:10:32 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2018-12-07 17:51:57 (GMT)
commitdff28141dcddd90b0bb95740d66b8f698cc8da6a (patch)
tree0a6a26af46a22a672f7e12a53550b7f691559dcb /Tests/RunCMake/UseSWIG/CMP0086-common.cmake
parent7b3d4799f8c03162d537e65effd3dd8d56fc3386 (diff)
downloadCMake-dff28141dcddd90b0bb95740d66b8f698cc8da6a.zip
CMake-dff28141dcddd90b0bb95740d66b8f698cc8da6a.tar.gz
CMake-dff28141dcddd90b0bb95740d66b8f698cc8da6a.tar.bz2
UseSWIG: add management of SWIG option -module
When file property SWIG_MODULE_NAME is specified, provide option -module to SWIG compiler. Fixes: #18374
Diffstat (limited to 'Tests/RunCMake/UseSWIG/CMP0086-common.cmake')
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-common.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-common.cmake b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake
new file mode 100644
index 0000000..c02592a
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake
@@ -0,0 +1,11 @@
+
+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)