diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2018-03-27 08:17:35 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@sap.com> | 2018-04-02 14:24:13 (GMT) |
commit | 438429d6fe04164b7ed70bda872e291d0df1a9e3 (patch) | |
tree | 048a336020ece4a135fa0afea6686efeb1e6b6bd /Tests | |
parent | e42fcb117fa1a8d063023bb39db96da93159ee40 (diff) | |
download | CMake-438429d6fe04164b7ed70bda872e291d0df1a9e3.zip CMake-438429d6fe04164b7ed70bda872e291d0df1a9e3.tar.gz CMake-438429d6fe04164b7ed70bda872e291d0df1a9e3.tar.bz2 |
UseSWIG: Rework tests
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/BasicPython.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/LegacyPython.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/MultipleModules.cmake | 30 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/RunCMakeTest.cmake | 27 | ||||
-rw-r--r-- | Tests/UseSWIG/BasicConfiguration.cmake (renamed from Tests/RunCMake/UseSWIG/BasicConfiguration.cmake) | 17 | ||||
-rw-r--r-- | Tests/UseSWIG/BasicPerl/CMakeLists.txt (renamed from Tests/RunCMake/UseSWIG/BasicPerl.cmake) | 12 | ||||
-rw-r--r-- | Tests/UseSWIG/BasicPython/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/UseSWIG/CMakeLists.txt | 62 | ||||
-rw-r--r-- | Tests/UseSWIG/LegacyConfiguration.cmake (renamed from Tests/RunCMake/UseSWIG/LegacyConfiguration.cmake) | 7 | ||||
-rw-r--r-- | Tests/UseSWIG/LegacyPerl/CMakeLists.txt (renamed from Tests/RunCMake/UseSWIG/LegacyPerl.cmake) | 12 | ||||
-rw-r--r-- | Tests/UseSWIG/LegacyPython/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/UseSWIG/MultipleModules/CMakeLists.txt | 38 | ||||
-rw-r--r-- | Tests/UseSWIG/MultiplePython/CMakeLists.txt (renamed from Tests/RunCMake/UseSWIG/MultiplePython.cmake) | 16 | ||||
-rw-r--r-- | Tests/UseSWIG/example.cxx (renamed from Tests/RunCMake/UseSWIG/example.cxx) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/example.h (renamed from Tests/RunCMake/UseSWIG/example.h) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/example.i (renamed from Tests/RunCMake/UseSWIG/example.i) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme.php4 (renamed from Tests/RunCMake/UseSWIG/runme.php4) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme.pike (renamed from Tests/RunCMake/UseSWIG/runme.pike) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme.pl (renamed from Tests/RunCMake/UseSWIG/runme.pl) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme.py (renamed from Tests/RunCMake/UseSWIG/runme.py) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme.rb (renamed from Tests/RunCMake/UseSWIG/runme.rb) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme.tcl (renamed from Tests/RunCMake/UseSWIG/runme.tcl) | 0 | ||||
-rw-r--r-- | Tests/UseSWIG/runme2.tcl (renamed from Tests/RunCMake/UseSWIG/runme2.tcl) | 0 |
26 files changed, 172 insertions, 105 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 1344692..1309c42 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1431,6 +1431,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindPython) endif() + if(CMake_TEST_UseSWIG) + add_subdirectory(UseSWIG) + endif() + add_subdirectory(FindThreads) # Matlab module diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index ff4a80e..c0c361e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -362,11 +362,6 @@ if(CMake_TEST_FindMatlab) add_RunCMake_test(FindMatlab) endif() -# UseSWIG related tests -if(CMake_TEST_UseSWIG) - add_RunCMake_test(UseSWIG) -endif() - add_executable(pseudo_emulator pseudo_emulator.c) add_executable(pseudo_emulator_custom_command pseudo_emulator_custom_command.c) add_RunCMake_test(CrosscompilingEmulator diff --git a/Tests/RunCMake/UseSWIG/BasicPython.cmake b/Tests/RunCMake/UseSWIG/BasicPython.cmake deleted file mode 100644 index 873dbe9..0000000 --- a/Tests/RunCMake/UseSWIG/BasicPython.cmake +++ /dev/null @@ -1,9 +0,0 @@ - -set(language "python") - -include (BasicConfiguration.cmake) - -add_custom_target (RunTest - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example>" - "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py" - DEPENDS example) diff --git a/Tests/RunCMake/UseSWIG/CMakeLists.txt b/Tests/RunCMake/UseSWIG/CMakeLists.txt deleted file mode 100644 index 2d75985..0000000 --- a/Tests/RunCMake/UseSWIG/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(${RunCMake_TEST} CXX) -include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/UseSWIG/LegacyPython.cmake b/Tests/RunCMake/UseSWIG/LegacyPython.cmake deleted file mode 100644 index 8b47aa2..0000000 --- a/Tests/RunCMake/UseSWIG/LegacyPython.cmake +++ /dev/null @@ -1,9 +0,0 @@ - -set(language "python") - -include (LegacyConfiguration.cmake) - -add_custom_target (RunTest - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:${SWIG_MODULE_example_REAL_NAME}>" - "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py" - DEPENDS ${SWIG_MODULE_example_REAL_NAME}) diff --git a/Tests/RunCMake/UseSWIG/MultipleModules.cmake b/Tests/RunCMake/UseSWIG/MultipleModules.cmake deleted file mode 100644 index e3d579f..0000000 --- a/Tests/RunCMake/UseSWIG/MultipleModules.cmake +++ /dev/null @@ -1,30 +0,0 @@ - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -find_package(PythonLibs REQUIRED) -find_package(PerlLibs REQUIRED) - -unset(CMAKE_SWIG_FLAGS) - -set (CMAKE_INCLUDE_CURRENT_DIR ON) - -set_property(SOURCE example.i PROPERTY CPLUSPLUS ON) -set_property(SOURCE example.i PROPERTY COMPILE_OPTIONS -includeall) - -set_property(SOURCE example.i PROPERTY GENERATED_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_PATH}) - -swig_add_library(example1 - LANGUAGE python - SOURCES example.i example.cxx) -target_link_libraries(example1 PRIVATE ${PYTHON_LIBRARIES}) - -# re-use sample interface file for another plugin -set_property(SOURCE example.i PROPERTY GENERATED_INCLUDE_DIRECTORIES ${PERL_INCLUDE_PATH}) -separate_arguments(c_flags UNIX_COMMAND "${PERL_EXTRA_C_FLAGS}") -set_property(SOURCE example.i PROPERTY GENERATED_COMPILE_OPTIONS ${c_flags}) - -swig_add_library(example2 - LANGUAGE perl - SOURCES example.i example.cxx) -target_link_libraries(example2 PRIVATE ${PERL_LIBRARY}) diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake deleted file mode 100644 index cded22f..0000000 --- a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake +++ /dev/null @@ -1,27 +0,0 @@ -include(RunCMake) - -function(run_SWIG test) - cmake_parse_arguments(_SWIG_TEST "" "TARGET" "" ${ARGN}) - if (_SWIG_TEST_TARGET) - list (INSERT _SWIG_TEST_TARGET 0 --target) - endif() - - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) - set(RunCMake_TEST_NO_CLEAN 1) - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) - set (RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release) - endif() - run_cmake(${test}) - run_cmake_command(${test}-test ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR} --config Release ${_SWIG_TEST_TARGET}) -endfunction() - -run_SWIG(LegacyPython TARGET RunTest) -run_SWIG(LegacyPerl TARGET RunTest) - -run_SWIG(BasicPython TARGET RunTest) -run_SWIG(BasicPerl TARGET RunTest) - -run_SWIG(MultipleModules) -run_SWIG(MultiplePython) diff --git a/Tests/RunCMake/UseSWIG/BasicConfiguration.cmake b/Tests/UseSWIG/BasicConfiguration.cmake index 2f46d63..73298567 100644 --- a/Tests/RunCMake/UseSWIG/BasicConfiguration.cmake +++ b/Tests/UseSWIG/BasicConfiguration.cmake @@ -52,16 +52,21 @@ unset(CMAKE_SWIG_FLAGS) set (CMAKE_INCLUDE_CURRENT_DIR ON) -set_property(SOURCE example.i PROPERTY CPLUSPLUS ON) -set_property(SOURCE example.i PROPERTY COMPILE_OPTIONS -includeall) +set_property(SOURCE "${CMAKE_CURRENT_LIST_DIR}/example.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "${CMAKE_CURRENT_LIST_DIR}/example.i" PROPERTY COMPILE_OPTIONS -includeall) -set_property(SOURCE example.i PROPERTY GENERATED_INCLUDE_DIRECTORIES ${SWIG_LANG_INCLUDE_DIRECTORIES}) -set_property(SOURCE example.i PROPERTY GENERATED_COMPILE_DEFINITIONS ${SWIG_LANG_DEFINITIONS}) -set_property(SOURCE example.i PROPERTY GENERATED_COMPILE_OPTIONS ${SWIG_LANG_OPTIONS}) +set_property(SOURCE "${CMAKE_CURRENT_LIST_DIR}/example.i" + PROPERTY GENERATED_INCLUDE_DIRECTORIES ${SWIG_LANG_INCLUDE_DIRECTORIES} + "${CMAKE_CURRENT_LIST_DIR}") +set_property(SOURCE "${CMAKE_CURRENT_LIST_DIR}/example.i" + PROPERTY GENERATED_COMPILE_DEFINITIONS ${SWIG_LANG_DEFINITIONS}) +set_property(SOURCE "${CMAKE_CURRENT_LIST_DIR}/example.i" + PROPERTY GENERATED_COMPILE_OPTIONS ${SWIG_LANG_OPTIONS}) SWIG_ADD_LIBRARY(example LANGUAGE "${language}" ${SWIG_LANG_TYPE} - SOURCES example.i example.cxx) + SOURCES "${CMAKE_CURRENT_LIST_DIR}/example.i" + "${CMAKE_CURRENT_LIST_DIR}/example.cxx") TARGET_LINK_LIBRARIES(example PRIVATE ${SWIG_LANG_LIBRARIES}) diff --git a/Tests/RunCMake/UseSWIG/BasicPerl.cmake b/Tests/UseSWIG/BasicPerl/CMakeLists.txt index 67ad6bc..10c1cd8 100644 --- a/Tests/RunCMake/UseSWIG/BasicPerl.cmake +++ b/Tests/UseSWIG/BasicPerl/CMakeLists.txt @@ -1,7 +1,12 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestBasicPerl CXX) + +include(CTest) set(language "perl") -include (BasicConfiguration.cmake) +include (../BasicConfiguration.cmake) if (WIN32) file (TO_CMAKE_PATH "$ENV{PATH}" perl_path) @@ -11,8 +16,7 @@ else() set (perl_env "LD_LIBRARY_PATH=$<TARGET_FILE_DIR:example>") endif() -add_custom_target (RunTest +add_test (NAME BasicPerl COMMAND "${CMAKE_COMMAND}" -E env "${perl_env}" "${PERL_EXECUTABLE}" "-I$<TARGET_FILE_DIR:example>" - "${CMAKE_CURRENT_SOURCE_DIR}/runme.pl" - DEPENDS example) + "${CMAKE_CURRENT_SOURCE_DIR}/../runme.pl") diff --git a/Tests/UseSWIG/BasicPython/CMakeLists.txt b/Tests/UseSWIG/BasicPython/CMakeLists.txt new file mode 100644 index 0000000..1ca4e25 --- /dev/null +++ b/Tests/UseSWIG/BasicPython/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestBasicPython CXX) + +include(CTest) + +set(language "python") + +include (../BasicConfiguration.cmake) + +add_test (NAME BasicPython + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example>" + "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt new file mode 100644 index 0000000..f7516e6 --- /dev/null +++ b/Tests/UseSWIG/CMakeLists.txt @@ -0,0 +1,62 @@ +add_test(NAME UseSWIG.LegacyPython COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/LegacyPython" + "${CMake_BINARY_DIR}/Tests/UseSWIG/LegacyPython" + ${build_generator_args} + --build-project TestLegacyPython + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) +add_test(NAME UseSWIG.LegacyPerl COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/LegacyPerl" + "${CMake_BINARY_DIR}/Tests/UseSWIG/LegacyPerl" + ${build_generator_args} + --build-project TestLegacyPerl + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + +add_test(NAME UseSWIG.BasicPython COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicPython" + "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPython" + ${build_generator_args} + --build-project TestBasicPython + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) +add_test(NAME UseSWIG.BasicPerl COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicPerl" + "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPerl" + ${build_generator_args} + --build-project TestBasicPerl + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + + +add_test(NAME UseSWIG.MultipleModules COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/MultipleModules" + "${CMake_BINARY_DIR}/Tests/UseSWIG/MultipleModules" + ${build_generator_args} + --build-project TestMultipleModules + --build-options ${build_options} + ) +add_test(NAME UseSWIG.MultiplePython COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/MultiplePython" + "${CMake_BINARY_DIR}/Tests/UseSWIG/MultiplePython" + ${build_generator_args} + --build-project TestMultiplePython + --build-options ${build_options} + ) diff --git a/Tests/RunCMake/UseSWIG/LegacyConfiguration.cmake b/Tests/UseSWIG/LegacyConfiguration.cmake index 3ce0790..640c713 100644 --- a/Tests/RunCMake/UseSWIG/LegacyConfiguration.cmake +++ b/Tests/UseSWIG/LegacyConfiguration.cmake @@ -51,10 +51,11 @@ unset(CMAKE_SWIG_FLAGS) include_directories(${CMAKE_CURRENT_LIST_DIR}) -set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON) -set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall") +set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/example.i" PROPERTIES CPLUSPLUS ON) +set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/example.i" PROPERTIES SWIG_FLAGS "-includeall") SWIG_ADD_LIBRARY(example LANGUAGE "${language}" ${SWIG_LANG_TYPE} - SOURCES example.i example.cxx) + SOURCES "${CMAKE_CURRENT_LIST_DIR}/example.i" + "${CMAKE_CURRENT_LIST_DIR}/example.cxx") SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES}) diff --git a/Tests/RunCMake/UseSWIG/LegacyPerl.cmake b/Tests/UseSWIG/LegacyPerl/CMakeLists.txt index 3428c46..0def5f5 100644 --- a/Tests/RunCMake/UseSWIG/LegacyPerl.cmake +++ b/Tests/UseSWIG/LegacyPerl/CMakeLists.txt @@ -1,7 +1,12 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestLegacyPerl CXX) + +include(CTest) set(language "perl") -include (LegacyConfiguration.cmake) +include (../LegacyConfiguration.cmake) if (WIN32) file (TO_CMAKE_PATH "$ENV{PATH}" perl_path) @@ -11,8 +16,7 @@ else() set (perl_env "LD_LIBRARY_PATH=$<TARGET_FILE_DIR:${SWIG_MODULE_example_REAL_NAME}>") endif() -add_custom_target (RunTest +add_test (NAME LegacyPerl COMMAND "${CMAKE_COMMAND}" -E env "${perl_env}" "${PERL_EXECUTABLE}" "-I$<TARGET_FILE_DIR:${SWIG_MODULE_example_REAL_NAME}>" - "${CMAKE_CURRENT_SOURCE_DIR}/runme.pl" - DEPENDS ${SWIG_MODULE_example_REAL_NAME}) + "${CMAKE_CURRENT_SOURCE_DIR}/../runme.pl") diff --git a/Tests/UseSWIG/LegacyPython/CMakeLists.txt b/Tests/UseSWIG/LegacyPython/CMakeLists.txt new file mode 100644 index 0000000..11a0d28 --- /dev/null +++ b/Tests/UseSWIG/LegacyPython/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestLegacyPython CXX) + +include(CTest) + +set(language "python") + +include (../LegacyConfiguration.cmake) + +add_test (NAME LegacyPython + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:${SWIG_MODULE_example_REAL_NAME}>" + "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") diff --git a/Tests/UseSWIG/MultipleModules/CMakeLists.txt b/Tests/UseSWIG/MultipleModules/CMakeLists.txt new file mode 100644 index 0000000..0f4ae75 --- /dev/null +++ b/Tests/UseSWIG/MultipleModules/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestMultipleModules CXX) + +include(CTest) + +find_package(SWIG REQUIRED) +include(${SWIG_USE_FILE}) + +find_package(Python REQUIRED COMPONENTS Development) + +find_package(PerlLibs REQUIRED) + +unset(CMAKE_SWIG_FLAGS) + +set_property(SOURCE "../example.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "../example.i" PROPERTY COMPILE_OPTIONS -includeall) + +set_property(SOURCE "../example.i" + PROPERTY GENERATED_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/..") + +swig_add_library(example1 + LANGUAGE python + OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python" + SOURCES ../example.i ../example.cxx) +target_link_libraries(example1 PRIVATE Python::Python) + +# re-use sample interface file for another plugin +set_property(SOURCE "../example.i" APPEND PROPERTY + GENERATED_INCLUDE_DIRECTORIES ${PERL_INCLUDE_PATH}) +separate_arguments(c_flags UNIX_COMMAND "${PERL_EXTRA_C_FLAGS}") +set_property(SOURCE "../example.i" PROPERTY GENERATED_COMPILE_OPTIONS ${c_flags}) + +swig_add_library(example2 + LANGUAGE perl + OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Perl" + SOURCES ../example.i ../example.cxx) +target_link_libraries(example2 PRIVATE ${PERL_LIBRARY}) diff --git a/Tests/RunCMake/UseSWIG/MultiplePython.cmake b/Tests/UseSWIG/MultiplePython/CMakeLists.txt index 3804bdd..f1ae42a 100644 --- a/Tests/RunCMake/UseSWIG/MultiplePython.cmake +++ b/Tests/UseSWIG/MultiplePython/CMakeLists.txt @@ -1,3 +1,8 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestMultiplePython CXX) + +include(CTest) find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) @@ -7,20 +12,21 @@ find_package(Python3 REQUIRED COMPONENTS Development) unset(CMAKE_SWIG_FLAGS) -set (CMAKE_INCLUDE_CURRENT_DIR ON) +set_property(SOURCE "../example.i" PROPERTY CPLUSPLUS ON) +set_property(SOURCE "../example.i" PROPERTY COMPILE_OPTIONS -includeall) -set_property(SOURCE example.i PROPERTY CPLUSPLUS ON) -set_property(SOURCE example.i PROPERTY COMPILE_OPTIONS -includeall) +set_property(SOURCE "../example.i" + PROPERTY GENERATED_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/..") swig_add_library(example1 LANGUAGE python OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python2" - SOURCES example.i example.cxx) + SOURCES ../example.i ../example.cxx) target_link_libraries(example1 PRIVATE Python2::Python) # re-use sample interface file for another plugin swig_add_library(example2 LANGUAGE python OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python3" - SOURCES example.i example.cxx) + SOURCES ../example.i ../example.cxx) target_link_libraries(example2 PRIVATE Python3::Python) diff --git a/Tests/RunCMake/UseSWIG/example.cxx b/Tests/UseSWIG/example.cxx index 961d6dd..961d6dd 100644 --- a/Tests/RunCMake/UseSWIG/example.cxx +++ b/Tests/UseSWIG/example.cxx diff --git a/Tests/RunCMake/UseSWIG/example.h b/Tests/UseSWIG/example.h index 366deb0..366deb0 100644 --- a/Tests/RunCMake/UseSWIG/example.h +++ b/Tests/UseSWIG/example.h diff --git a/Tests/RunCMake/UseSWIG/example.i b/Tests/UseSWIG/example.i index fbdf724..fbdf724 100644 --- a/Tests/RunCMake/UseSWIG/example.i +++ b/Tests/UseSWIG/example.i diff --git a/Tests/RunCMake/UseSWIG/runme.php4 b/Tests/UseSWIG/runme.php4 index 653ced2..653ced2 100644 --- a/Tests/RunCMake/UseSWIG/runme.php4 +++ b/Tests/UseSWIG/runme.php4 diff --git a/Tests/RunCMake/UseSWIG/runme.pike b/Tests/UseSWIG/runme.pike index ec28dd7..ec28dd7 100644 --- a/Tests/RunCMake/UseSWIG/runme.pike +++ b/Tests/UseSWIG/runme.pike diff --git a/Tests/RunCMake/UseSWIG/runme.pl b/Tests/UseSWIG/runme.pl index 965e063..965e063 100644 --- a/Tests/RunCMake/UseSWIG/runme.pl +++ b/Tests/UseSWIG/runme.pl diff --git a/Tests/RunCMake/UseSWIG/runme.py b/Tests/UseSWIG/runme.py index af5e07d..af5e07d 100644 --- a/Tests/RunCMake/UseSWIG/runme.py +++ b/Tests/UseSWIG/runme.py diff --git a/Tests/RunCMake/UseSWIG/runme.rb b/Tests/UseSWIG/runme.rb index de73bcd..de73bcd 100644 --- a/Tests/RunCMake/UseSWIG/runme.rb +++ b/Tests/UseSWIG/runme.rb diff --git a/Tests/RunCMake/UseSWIG/runme.tcl b/Tests/UseSWIG/runme.tcl index 6055cf6..6055cf6 100644 --- a/Tests/RunCMake/UseSWIG/runme.tcl +++ b/Tests/UseSWIG/runme.tcl diff --git a/Tests/RunCMake/UseSWIG/runme2.tcl b/Tests/UseSWIG/runme2.tcl index d0b5c21..d0b5c21 100644 --- a/Tests/RunCMake/UseSWIG/runme2.tcl +++ b/Tests/UseSWIG/runme2.tcl |