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.
This commit is contained in:
Zack Galbreath
2026-05-29 07:21:10 -04:00
parent ba768963e5
commit 7dc39e7221
14 changed files with 178 additions and 6 deletions

View File

@@ -23,8 +23,8 @@ Build the project and store results in ``Build.xml``
for submission with the :command:`ctest_submit` command.
The :variable:`CTEST_BUILD_COMMAND` variable may be set to explicitly
specify the build command line. Otherwise the build command line is
computed automatically based on the options given.
specify the build command line when no preset is selected. Otherwise
the build command line is computed automatically based on the options given.
The options are:
@@ -86,6 +86,9 @@ The options are:
argument will override the :preset:`buildPresets.targets` setting from
the chosen preset.
When a preset is specified, the :variable:`CTEST_BUILD_COMMAND`
variable is ignored so that the preset is always honored.
See also the :variable:`CTEST_BUILD_PRESET` and
:variable:`CTEST_PRESET` variables.

View File

@@ -46,8 +46,8 @@ The options are:
:variable:`CTEST_BINARY_DIRECTORY` variable will override the
:preset:`configurePresets.binaryDir` setting from the chosen preset.
This option is ignored when :variable:`CTEST_CONFIGURE_COMMAND`
is used.
When a preset is specified, the :variable:`CTEST_CONFIGURE_COMMAND`
variable is ignored so that the preset is always honored.
See also the :variable:`CTEST_CONFIGURE_PRESET` and
:variable:`CTEST_PRESET` variables.