diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-07-16 14:18:31 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2021-07-16 14:25:40 (GMT) |
commit | aa874dc6090cf6b6c9621572419738d105ff4ba3 (patch) | |
tree | c61ee79c28a4d8b3ff104eb317195eb738c8f2f7 /Tests/RunCMake/CMakePresets/RunCMakeTest.cmake | |
parent | 7c6234dd21b7af95e7edea6b281d859dafb2ae81 (diff) | |
download | CMake-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.cmake | 5 |
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) |