diff options
author | Henri Manson <hfmanson@gmail.com> | 2019-03-04 11:40:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-11 15:39:25 (GMT) |
commit | 463c2fba4eec7f364689a11b7c36afe966b1f151 (patch) | |
tree | 968eb63ed218579fd19f30412b3e3959cd5ae744 /Tests/GeneratorExpression | |
parent | 21da25d2a878cfccf9496ef7b227de2c98601ef2 (diff) | |
download | CMake-463c2fba4eec7f364689a11b7c36afe966b1f151.zip CMake-463c2fba4eec7f364689a11b7c36afe966b1f151.tar.gz CMake-463c2fba4eec7f364689a11b7c36afe966b1f151.tar.bz2 |
Genex: Teach SHELL_PATH to support a list of paths
Extend the genex added by commit ca6ba3fee5 (Genex: Add a SHELL_PATH
expression, 2015-09-24, v3.4.0-rc1~37^2) to accept a `;`-list of paths,
convert them all, and generate a list separated by the native shell
`PATH``` separator.
Diffstat (limited to 'Tests/GeneratorExpression')
-rw-r--r-- | Tests/GeneratorExpression/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/GeneratorExpression/check-part4.cmake | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index ab6016b..df0c78d 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -256,8 +256,10 @@ add_custom_target(check-part3 ALL if(WIN32) set(test_shell_path c:/shell/path) + set(test_shell_path2 c:/shell/path d:/another/path) else() set(test_shell_path /shell/path) + set(test_shell_path2 /shell/path /another/path) endif() add_custom_target(check-part4 ALL @@ -266,6 +268,7 @@ add_custom_target(check-part4 ALL # CMake as command-line argument -Dmsys1_prefix=${msys1_prefix} -Dtest_shell_path=${msys1_prefix}$<SHELL_PATH:${test_shell_path}> + "-Dtest_shell_path2=$<SHELL_PATH:${test_shell_path2}>" -Dif_1=$<IF:1,a,b> -Dif_2=$<IF:0,a,b> -Dif_3=$<IF:$<EQUAL:10,30>,a,b> diff --git a/Tests/GeneratorExpression/check-part4.cmake b/Tests/GeneratorExpression/check-part4.cmake index b6966de..a7e0944 100644 --- a/Tests/GeneratorExpression/check-part4.cmake +++ b/Tests/GeneratorExpression/check-part4.cmake @@ -15,6 +15,17 @@ if(WIN32) else() check(test_shell_path [[/shell/path]]) endif() +if(WIN32) + if(CMAKE_GENERATOR STREQUAL "MSYS Makefiles" AND NOT msys1_prefix) + check(test_shell_path2 [[/c/shell/path:/d/another/path]]) + elseif(CMAKE_GENERATOR STREQUAL "Unix Makefiles") + check(test_shell_path2 [[c:/shell/path;d:/another/path]]) + else() + check(test_shell_path2 [[c:\shell\path;d:\another\path]]) + endif() +else() + check(test_shell_path2 [[/shell/path:/another/path]]) +endif() check(if_1 "a") check(if_2 "b") |