summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorMartin Duffy <martin.duffy@kitware.com>2023-03-22 17:11:21 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-29 14:41:19 (GMT)
commit19305afd8a2a46925b1a880de68f7be0ad1f3091 (patch)
treecdef4417cd852c2a5dd85886df4ff61d7fd2e653 /Source/cmCTest.cxx
parent6b08358e17f5b85ad04ab512e4b6e39e989cea35 (diff)
downloadCMake-19305afd8a2a46925b1a880de68f7be0ad1f3091.zip
CMake-19305afd8a2a46925b1a880de68f7be0ad1f3091.tar.gz
CMake-19305afd8a2a46925b1a880de68f7be0ad1f3091.tar.bz2
presets: Improve JSON parser and error messages
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 5899a61..c8eea38 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -54,6 +54,7 @@
#include "cmDynamicLoader.h"
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
+#include "cmJSONState.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
#include "cmState.h"
@@ -2336,10 +2337,10 @@ bool cmCTest::SetArgsFromPreset(const std::string& presetName,
cmCMakePresetsGraph settingsFile;
auto result = settingsFile.ReadProjectPresets(workingDirectory);
- if (result != cmCMakePresetsGraph::ReadFileResult::READ_OK) {
- cmSystemTools::Error(
- cmStrCat("Could not read presets from ", workingDirectory, ": ",
- cmCMakePresetsGraph::ResultToString(result)));
+ if (result != true) {
+ cmSystemTools::Error(cmStrCat("Could not read presets from ",
+ workingDirectory, ":",
+ settingsFile.parseState.GetErrorMessage()));
return false;
}