diff options
author | Erin Melucci <emelucci@opera.com> | 2022-05-09 17:18:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-05-12 14:37:49 (GMT) |
commit | ba969ce5fe3a363b52dd4f0290e4b827272101fb (patch) | |
tree | b3a8747cdf46785bd05851fccb2f35e7778723bd /Tests | |
parent | ef10e61b6b7d3bb264cdbf72e143dbef7be8c736 (diff) | |
download | CMake-ba969ce5fe3a363b52dd4f0290e4b827272101fb.zip CMake-ba969ce5fe3a363b52dd4f0290e4b827272101fb.tar.gz CMake-ba969ce5fe3a363b52dd4f0290e4b827272101fb.tar.bz2 |
cmake-presets: add ${pathListSep} macro
Fixes: #23282
Diffstat (limited to 'Tests')
6 files changed, 42 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/PathListSep.cmake b/Tests/RunCMake/CMakePresets/PathListSep.cmake new file mode 100644 index 0000000..52c225b --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PathListSep.cmake @@ -0,0 +1,7 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +if(CMAKE_HOST_WIN32) + test_variable(TEST_PATH_LIST_SEP "" "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_SOURCE_DIR}") +else() + test_variable(TEST_PATH_LIST_SEP "" "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_SOURCE_DIR}") +endif() diff --git a/Tests/RunCMake/CMakePresets/PathListSep.json.in b/Tests/RunCMake/CMakePresets/PathListSep.json.in new file mode 100644 index 0000000..4c25029 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PathListSep.json.in @@ -0,0 +1,13 @@ +{ + "version": 5, + "configurePresets": [ + { + "name": "PathListSep", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "TEST_PATH_LIST_SEP": "${sourceDir}${pathListSep}${sourceDir}" + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/PathListSepFuture-result.txt b/Tests/RunCMake/CMakePresets/PathListSepFuture-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PathListSepFuture-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/PathListSepFuture-stderr.txt b/Tests/RunCMake/CMakePresets/PathListSepFuture-stderr.txt new file mode 100644 index 0000000..b961aaf --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PathListSepFuture-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/PathListSepFuture: Invalid macro expansion$ diff --git a/Tests/RunCMake/CMakePresets/PathListSepFuture.json.in b/Tests/RunCMake/CMakePresets/PathListSepFuture.json.in new file mode 100644 index 0000000..2fd6b7e --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PathListSepFuture.json.in @@ -0,0 +1,13 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "PathListSepFuture", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "TEST_PATH_LIST_SEP": "${sourceDir}${pathListSep}${sourceDir}" + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index 5867efd..d097086 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -335,6 +335,12 @@ unset(CMakePresets_EXTRA_FILES) set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/FileDirFuture.json.in") run_cmake_presets(FileDirFuture) +# Test ${pathListSep} macro +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/PathListSep.json.in") +run_cmake_presets(PathListSep) +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/PathListSepFuture.json.in") +run_cmake_presets(PathListSepFuture) + # Test conditions set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Conditions.json.in") run_cmake_presets(ListConditions --list-presets) |