diff options
Diffstat (limited to 'Tests/UseSWIG/MultipleFiles/CMakeLists.txt')
-rw-r--r-- | Tests/UseSWIG/MultipleFiles/CMakeLists.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/UseSWIG/MultipleFiles/CMakeLists.txt b/Tests/UseSWIG/MultipleFiles/CMakeLists.txt new file mode 100644 index 0000000..bf3d946 --- /dev/null +++ b/Tests/UseSWIG/MultipleFiles/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.18) + +project(TestMultipleFiles CXX) + +find_package(SWIG REQUIRED) +include(UseSWIG) + +unset(SWIG_LANG_TYPE) +unset(SWIG_LANG_INCLUDE_DIRECTORIES) +unset(SWIG_LANG_DEFINITIONS) +unset(SWIG_LANG_OPTIONS) +unset(SWIG_LANG_LIBRARIES) + +find_package(Python3 REQUIRED COMPONENTS Development) + +set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/add.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/sub.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/add.i" PROPERTY SWIG_MODULE_NAME _add) +set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/sub.i" PROPERTY SWIG_MODULE_NAME _sub) + + +swig_add_library(example + LANGUAGE python + TYPE MODULE + SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/add.i" + "${CMAKE_CURRENT_SOURCE_DIR}/sub.i" + "${CMAKE_CURRENT_SOURCE_DIR}/add.cxx" + "${CMAKE_CURRENT_SOURCE_DIR}/sub.cxx") +target_include_directories(example PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") +target_link_libraries(example PRIVATE Python3::Module) |