summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-23 13:50:40 (GMT)
committerBrad King <brad.king@kitware.com>2021-02-23 14:11:44 (GMT)
commit3357d377612fc238ff9da61666041764792034bb (patch)
tree36d7e26521e0a613f2f5ee74d0b3c798a23ee01f /Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
parent2f13fdef0a9471165751f628cb4b2ba7b83b1ae1 (diff)
downloadCMake-3357d377612fc238ff9da61666041764792034bb.zip
CMake-3357d377612fc238ff9da61666041764792034bb.tar.gz
CMake-3357d377612fc238ff9da61666041764792034bb.tar.bz2
cmake: Add support for '--build --prefix=<prefix>' form of the argument
The main `cmake --preset` argument for configure presets supports both forms, so support it for `cmake --build --preset` too. Issue: #21855
Diffstat (limited to 'Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake12
1 files changed, 10 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
index 9491524..fd95c2c 100644
--- a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
@@ -40,6 +40,7 @@ function(run_cmake_build_presets name CMakePresetsBuild_CONFIGURE_PRESETS CMakeP
endforeach()
endif()
+ set(eq 0)
foreach(BUILD_PRESET ${CMakePresetsBuild_BUILD_PRESETS})
if (EXISTS "${RunCMake_SOURCE_DIR}/${name}-build-${BUILD_PRESET}-check.cmake")
set(RunCMake-check-file "${name}-build-${BUILD_PRESET}-check.cmake")
@@ -47,8 +48,15 @@ function(run_cmake_build_presets name CMakePresetsBuild_CONFIGURE_PRESETS CMakeP
set(RunCMake-check-file "check.cmake")
endif()
- run_cmake_command(${name}-build-${BUILD_PRESET}
- ${CMAKE_COMMAND} "--build" "--preset" "${BUILD_PRESET}" ${ARGN})
+ if(eq)
+ run_cmake_command(${name}-build-${BUILD_PRESET}
+ ${CMAKE_COMMAND} "--build" "--preset=${BUILD_PRESET}" ${ARGN})
+ set(eq 0)
+ else()
+ run_cmake_command(${name}-build-${BUILD_PRESET}
+ ${CMAKE_COMMAND} "--build" "--preset" "${BUILD_PRESET}" ${ARGN})
+ set(eq 1)
+ endif()
endforeach()
endfunction()