summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-09 15:37:07 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-09 15:37:14 (GMT)
commit65522e5e0ef95b7424714ec4d67345bf00e9b8bd (patch)
treea0ec37ca342550c81d690141cff2c808062a4eb4 /Source
parent9463d73cc4d58b190fac0cac6aeee424b5d29514 (diff)
parentf29e2292c90d4fbdadce041b1c9d649aca3c602b (diff)
downloadCMake-65522e5e0ef95b7424714ec4d67345bf00e9b8bd.zip
CMake-65522e5e0ef95b7424714ec4d67345bf00e9b8bd.tar.gz
CMake-65522e5e0ef95b7424714ec4d67345bf00e9b8bd.tar.bz2
Merge topic 'cpack-improve-unknown-generator-error'
f29e2292c9 cpack: When given an unknown generator print out all valid generators eba7273c20 cpack: Better error message when generator doesn't exist. Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: David Cole <dlrdave@aol.com> Merge-request: !2580
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cpack.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index c083945..7cf69fc 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -21,6 +21,7 @@
#include "cmCPackLog.h"
#include "cmDocumentation.h"
#include "cmDocumentationEntry.h"
+#include "cmDocumentationFormatter.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmStateSnapshot.h"
@@ -358,8 +359,21 @@ int main(int argc, char const* const* argv)
cpackGenerator->SetTraceExpand(traceExpand);
} else {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
- "Cannot initialize CPack generator: " << gen
- << std::endl);
+ "Could not create CPack generator: " << gen
+ << std::endl);
+ // Print out all the valid generators
+ cmDocumentation generatorDocs;
+ std::vector<cmDocumentationEntry> v;
+ for (auto const& g : generators.GetGeneratorsList()) {
+ cmDocumentationEntry e;
+ e.Name = g.first;
+ e.Brief = g.second;
+ v.push_back(std::move(e));
+ }
+ generatorDocs.SetSection("Generators", v);
+ std::cerr << "\n";
+ generatorDocs.PrintDocumentation(cmDocumentation::ListGenerators,
+ std::cerr);
parsed = 0;
}