diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-03-29 18:28:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-10 19:14:34 (GMT) |
commit | 588dcb33b7ff089a84ce5cbacf2696b4a3646b42 (patch) | |
tree | 33fd43e30550fdf09440d76b7d6d75a13eb21d58 /Source/cmake.cxx | |
parent | 4e039a9a9814fd13142ae2c9876420ddf2414b8e (diff) | |
download | CMake-588dcb33b7ff089a84ce5cbacf2696b4a3646b42.zip CMake-588dcb33b7ff089a84ce5cbacf2696b4a3646b42.tar.gz CMake-588dcb33b7ff089a84ce5cbacf2696b4a3646b42.tar.bz2 |
cmake: Provide guidance when an invalid -G option is given
Print a list of generators if no generator or an invalid one is
supplied.
Signed-off-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7595155..3654aa7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -818,6 +818,7 @@ void cmake::SetArgs(const std::vector<std::string>& args, if(i >= args.size()) { cmSystemTools::Error("No generator specified for -G"); + this->PrintGeneratorList(); return; } value = args[i]; @@ -828,6 +829,7 @@ void cmake::SetArgs(const std::vector<std::string>& args, { cmSystemTools::Error("Could not create named generator ", value.c_str()); + this->PrintGeneratorList(); } else { @@ -1961,6 +1963,18 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v) } } +void cmake::PrintGeneratorList() +{ +#ifdef CMAKE_BUILD_WITH_CMAKE + cmDocumentation doc; + std::vector<cmDocumentationEntry> generators; + this->GetGeneratorDocumentation(generators); + doc.AppendSection("Generators",generators); + std::cerr << "\n"; + doc.PrintDocumentation(cmDocumentation::ListGenerators, std::cerr); +#endif +} + void cmake::UpdateConversionPathTable() { // Update the path conversion table with any specified file: @@ -2438,6 +2452,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args) if(i >= args.size()) { cmSystemTools::Error("No generator specified for -G"); + this->PrintGeneratorList(); return -1; } value = args[i]; @@ -2448,6 +2463,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args) { cmSystemTools::Error("Could not create named generator ", value.c_str()); + this->PrintGeneratorList(); } else { |