mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
cpack: When given an unknown generator print out all valid generators
This makes cpack behavior match cmake when passed an invalid generator
This commit is contained in:
committed by
Brad King
parent
eba7273c20
commit
f29e2292c9
@@ -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"
|
||||
@@ -360,7 +361,19 @@ int main(int argc, char const* const* argv)
|
||||
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
|
||||
"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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user