summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-04 13:38:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-08-04 13:38:34 (GMT)
commitf05ec53112d8fd4caf8573d3b5c9f859303dd0f3 (patch)
tree48d5d80fbb901b88d2d4e5a8f2fac4e22793a3dc /Source/cmake.cxx
parent52dec3f11f87cc66a69fce94a7bedf046d867682 (diff)
parent47929ee98c44d84d9e86e23cc93093f857e11780 (diff)
downloadCMake-f05ec53112d8fd4caf8573d3b5c9f859303dd0f3.zip
CMake-f05ec53112d8fd4caf8573d3b5c9f859303dd0f3.tar.gz
CMake-f05ec53112d8fd4caf8573d3b5c9f859303dd0f3.tar.bz2
Merge topic 'cmake-preset-error-reporting'
47929ee98c presets: Add basic error forwarding from cmake preset json parser Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7495
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 12d42b2..9b2b119 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1283,9 +1283,13 @@ void cmake::SetArgs(const std::vector<std::string>& args)
cmCMakePresetsGraph presetsGraph;
auto result = presetsGraph.ReadProjectPresets(this->GetHomeDirectory());
if (result != cmCMakePresetsGraph::ReadFileResult::READ_OK) {
- cmSystemTools::Error(
+ std::string errorMsg =
cmStrCat("Could not read presets from ", this->GetHomeDirectory(),
- ": ", cmCMakePresetsGraph::ResultToString(result)));
+ ": ", cmCMakePresetsGraph::ResultToString(result));
+ if (!presetsGraph.errors.empty()) {
+ errorMsg = cmStrCat(errorMsg, "\nErrors:\n", presetsGraph.errors);
+ }
+ cmSystemTools::Error(errorMsg);
return;
}