diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2018-04-05 10:09:53 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@sap.com> | 2018-04-05 10:09:53 (GMT) |
commit | 38dcdd76413c012a569eccb67c195f1d6840e2b8 (patch) | |
tree | 71a140462721242f9ff83ea0cd62777e3c101a99 /Tests/UseSWIG/MultiplePython | |
parent | 3201e4c156fcf79a7c29a73430e72b1bcd43cedc (diff) | |
download | CMake-38dcdd76413c012a569eccb67c195f1d6840e2b8.zip CMake-38dcdd76413c012a569eccb67c195f1d6840e2b8.tar.gz CMake-38dcdd76413c012a569eccb67c195f1d6840e2b8.tar.bz2 |
UseSWIG: Ensure tests are usable in multi-config mode.
Fixes: #17875
Diffstat (limited to 'Tests/UseSWIG/MultiplePython')
-rw-r--r-- | Tests/UseSWIG/MultiplePython/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/UseSWIG/MultiplePython/CMakeLists.txt b/Tests/UseSWIG/MultiplePython/CMakeLists.txt index 260a382..a5e3eed 100644 --- a/Tests/UseSWIG/MultiplePython/CMakeLists.txt +++ b/Tests/UseSWIG/MultiplePython/CMakeLists.txt @@ -10,6 +10,13 @@ include(${SWIG_USE_FILE}) find_package(Python2 REQUIRED COMPONENTS Interpreter Development) find_package(Python3 REQUIRED COMPONENTS Interpreter Development) +# Path separator +if (WIN32) + set (PS "$<SEMICOLON>") +else() + set (PS ":") +endif() + unset(CMAKE_SWIG_FLAGS) set_property(SOURCE "../example.i" PROPERTY CPLUSPLUS ON) @@ -44,9 +51,9 @@ target_link_libraries(example2 PRIVATE Python3::Python) add_test (NAME MultiplePython.example1 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example1>" + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/Python2${PS}$<TARGET_FILE_DIR:example1>" "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") add_test (NAME MultiplePython.example2 - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example2>" + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/Python3${PS}$<TARGET_FILE_DIR:example2>" "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") |