diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-07-23 14:54:12 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-09-06 08:52:25 (GMT) |
commit | eb583b0a660ba68e8e3b5f820301fde333619283 (patch) | |
tree | d88a52fdc1af9843ee4adceb1a37c66148d48c2e /Tests/RunCMake/cmake_path/call-cmake_path.cmake | |
parent | 212e953d352c2ca20cf6280492633d21fbacdbc9 (diff) | |
download | CMake-eb583b0a660ba68e8e3b5f820301fde333619283.zip CMake-eb583b0a660ba68e8e3b5f820301fde333619283.tar.gz CMake-eb583b0a660ba68e8e3b5f820301fde333619283.tar.bz2 |
cmake_path command: path management
Fixes: #19568, #20922
Diffstat (limited to 'Tests/RunCMake/cmake_path/call-cmake_path.cmake')
-rw-r--r-- | Tests/RunCMake/cmake_path/call-cmake_path.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_path/call-cmake_path.cmake b/Tests/RunCMake/cmake_path/call-cmake_path.cmake new file mode 100644 index 0000000..70fd6f5 --- /dev/null +++ b/Tests/RunCMake/cmake_path/call-cmake_path.cmake @@ -0,0 +1,19 @@ + +cmake_minimum_required(VERSION 3.18...3.19) + +# define input variable +set (path "") + +separate_arguments(CMAKE_PATH_ARGUMENTS UNIX_COMMAND "${CMAKE_PATH_ARGUMENTS}") + +if (CHECK_INVALID_OUTPUT) + # special handling for CMAKE_PATH + list(GET CMAKE_PATH_ARGUMENTS 0 command) + if (command STREQUAL "CMAKE_PATH") + cmake_path(CMAKE_PATH "" "input") + else() + cmake_path(${CMAKE_PATH_ARGUMENTS} "") + endif() +else() + cmake_path(${CMAKE_PATH_ARGUMENTS}) +endif() |