diff options
author | Brad King <brad.king@kitware.com> | 2022-08-04 13:38:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-08-04 13:38:34 (GMT) |
commit | f05ec53112d8fd4caf8573d3b5c9f859303dd0f3 (patch) | |
tree | 48d5d80fbb901b88d2d4e5a8f2fac4e22793a3dc /Source/cmake.cxx | |
parent | 52dec3f11f87cc66a69fce94a7bedf046d867682 (diff) | |
parent | 47929ee98c44d84d9e86e23cc93093f857e11780 (diff) | |
download | CMake-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.cxx | 8 |
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; } |