Files
cmake/Tests/RunCMake/ctest_build/BuildConfigurationCLIVar-check.cmake
Zack Galbreath 7dc39e7221 ctest: prioritize presets over existing DartConfiguration.tcl commands
CMake writes ConfigureCommand and MakeCommand entries into
DartConfiguration.tcl when configuring a project that uses the CTest module.

These values prevented users from being able to use configure/build presets
in dashboard client mode from a pre-configured build directory.

This commit updates ctest_configure() and ctest_build() to ignore
CTEST_CONFIGURE_COMMAND / CTEST_BUILD_COMMAND when a preset is specified.
This allows the requested preset to be honored.
2026-05-29 11:40:47 -04:00

14 lines
519 B
CMake

file(GLOB build_xml_file "${RunCMake_TEST_BINARY_DIR}/Testing/*/Build.xml")
if(build_xml_file)
file(READ "${build_xml_file}" build_xml)
if(NOT build_xml MATCHES "--preset.*my-build-preset")
set(RunCMake_TEST_FAILED
"Build.xml does not contain the expected --preset argument")
elseif(NOT build_xml MATCHES "--config.*my-config")
set(RunCMake_TEST_FAILED
"Build.xml does not contain the expected --config argument")
endif()
else()
set(RunCMake_TEST_FAILED "Build.xml not found")
endif()