summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-07-16 14:18:31 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-07-16 14:25:40 (GMT)
commitaa874dc6090cf6b6c9621572419738d105ff4ba3 (patch)
treec61ee79c28a4d8b3ff104eb317195eb738c8f2f7 /Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
parent7c6234dd21b7af95e7edea6b281d859dafb2ae81 (diff)
downloadCMake-aa874dc6090cf6b6c9621572419738d105ff4ba3.zip
CMake-aa874dc6090cf6b6c9621572419738d105ff4ba3.tar.gz
CMake-aa874dc6090cf6b6c9621572419738d105ff4ba3.tar.bz2
CMakePresets.json: Fix expansion issue with empty binaryDir
When resolving binaryDir into a full path from a relative path, we forgot to check if binaryDir is altogether empty, causing empty binaryDir's to resolve to the source directory. Fix this. Fixes: #22434
Diffstat (limited to 'Tests/RunCMake/CMakePresets/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index 3b9806a..31bd8a4 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -312,6 +312,11 @@ unset(CMakePresets_FILE)
# Test optional generator and buildDir fields
run_cmake_presets(OptionalBinaryDirField -B "${RunCMake_BINARY_DIR}/OptionalBinaryDirField/build")
run_cmake_presets(OptionalGeneratorField -G "${RunCMake_GENERATOR}")
+set(CMakePresets_NO_S_ARG TRUE)
+set(CMakePresets_SOURCE_ARG "../OptionalBinaryDirFieldNoS")
+run_cmake_presets(OptionalBinaryDirFieldNoS)
+unset(CMakePresets_SOURCE_ARG)
+unset(CMakePresets_NO_S_ARG)
# Test the example from the documentation
file(READ "${RunCMake_SOURCE_DIR}/../../../Help/manual/presets/example.json" _example)