diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-03-10 19:59:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-03-22 19:04:54 (GMT) |
commit | 8bc5c8961e552a15091b7f4d2c205ce90b8f764f (patch) | |
tree | ac9fe9a92c01accd1fee2c4914347369546f85ff /Source/cmCTest.cxx | |
parent | ce6ea7c927b9f80f219a7783ce725bea4c24091f (diff) | |
download | CMake-8bc5c8961e552a15091b7f4d2c205ce90b8f764f.zip CMake-8bc5c8961e552a15091b7f4d2c205ce90b8f764f.tar.gz CMake-8bc5c8961e552a15091b7f4d2c205ce90b8f764f.tar.bz2 |
CMakePresets.json: Add the ability to conditionally disable presets
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 77b4441..4228d30 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2310,6 +2310,13 @@ bool cmCTest::SetArgsFromPreset(const std::string& presetName, return false; } + if (!expandedPreset->ConditionResult) { + cmSystemTools::Error(cmStrCat("Cannot use disabled test preset in ", + workingDirectory, ": \"", presetName, '"')); + settingsFile.PrintTestPresetList(); + return false; + } + auto configurePresetPair = settingsFile.ConfigurePresets.find(expandedPreset->ConfigurePreset); if (configurePresetPair == settingsFile.ConfigurePresets.end()) { |