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/MultipleModules | |
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/MultipleModules')
-rw-r--r-- | Tests/UseSWIG/MultipleModules/CMakeLists.txt | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Tests/UseSWIG/MultipleModules/CMakeLists.txt b/Tests/UseSWIG/MultipleModules/CMakeLists.txt index d495007..578825f 100644 --- a/Tests/UseSWIG/MultipleModules/CMakeLists.txt +++ b/Tests/UseSWIG/MultipleModules/CMakeLists.txt @@ -12,6 +12,13 @@ find_package(Python REQUIRED COMPONENTS Interpreter Development) find_package(Perl REQUIRED) find_package(PerlLibs REQUIRED) +# Path separator +if (WIN32) + set (PS "$<SEMICOLON>") +else() + set (PS ":") +endif() + unset(CMAKE_SWIG_FLAGS) set_property(SOURCE "../example.i" PROPERTY CPLUSPLUS ON) @@ -51,19 +58,11 @@ target_link_libraries(example2 PRIVATE ${PERL_LIBRARY}) add_test (NAME MultipleModules.Python - COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:example1>" + COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/Python${PS}$<TARGET_FILE_DIR:example1>" "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py") -if (WIN32) - file (TO_CMAKE_PATH "$ENV{PATH}" perl_path) - string (REPLACE ";" "$<SEMICOLON>" perl_path "${perl_path}") - set (perl_env "PATH=$<TARGET_FILE_DIR:example2>$<SEMICOLON>${perl_path}") -else() - set (perl_env "LD_LIBRARY_PATH=$<TARGET_FILE_DIR:example2>") -endif() - add_test (NAME MultipleModules.Perl - COMMAND "${CMAKE_COMMAND}" -E env "${perl_env}" - "${PERL_EXECUTABLE}" "-I$<TARGET_FILE_DIR:example2>" + COMMAND "${PERL_EXECUTABLE}" "-I${CMAKE_CURRENT_BINARY_DIR}/Perl" + "-I$<TARGET_FILE_DIR:example2>" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.pl") |