diff options
author | Brad King <brad.king@kitware.com> | 2021-02-23 14:12:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-23 14:22:00 (GMT) |
commit | 6fa36470239a40ef81752ddea923d8618ad6eb7c (patch) | |
tree | b1a9b98b5485f9a824d5986446163883bc22b62d /Tests/RunCMake/CMakePresetsTest | |
parent | 3357d377612fc238ff9da61666041764792034bb (diff) | |
download | CMake-6fa36470239a40ef81752ddea923d8618ad6eb7c.zip CMake-6fa36470239a40ef81752ddea923d8618ad6eb7c.tar.gz CMake-6fa36470239a40ef81752ddea923d8618ad6eb7c.tar.bz2 |
ctest: Add support for '--prefix=<prefix>' form of the argument
The main `cmake --preset` argument for configure presets supports both
forms, so support it for `ctest --preset` too.
Fixes: #21855
Diffstat (limited to 'Tests/RunCMake/CMakePresetsTest')
-rw-r--r-- | Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake index 6360fc2..4ffdfab 100644 --- a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake @@ -51,6 +51,7 @@ function(run_cmake_test_presets name CMakePresetsTest_CONFIGURE_PRESETS CMakePre endforeach() endif() + set(eq 0) foreach(TEST_PRESET ${CMakePresetsTest_TEST_PRESETS}) if (EXISTS "${RunCMake_SOURCE_DIR}/${name}-test-${TEST_PRESET}-check.cmake") set(RunCMake-check-file "${name}-test-${TEST_PRESET}-check.cmake") @@ -58,8 +59,15 @@ function(run_cmake_test_presets name CMakePresetsTest_CONFIGURE_PRESETS CMakePre set(RunCMake-check-file "check.cmake") endif() - run_cmake_command(${name}-test-${TEST_PRESET} - ${CMAKE_CTEST_COMMAND} "--preset" "${TEST_PRESET}" ${ARGN}) + if(eq) + run_cmake_command(${name}-test-${TEST_PRESET} + ${CMAKE_CTEST_COMMAND} "--preset=${TEST_PRESET}" ${ARGN}) + set(eq 0) + else() + run_cmake_command(${name}-test-${TEST_PRESET} + ${CMAKE_CTEST_COMMAND} "--preset" "${TEST_PRESET}" ${ARGN}) + set(eq 1) + endif() endforeach() endfunction() |