diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-07-20 16:28:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-03 13:43:00 (GMT) |
commit | a354f60ce07cd67bd60161824a4e74bf9068fea4 (patch) | |
tree | 14c272760205567469ddd856a99e98ace6282841 /Source/cmExtraKateGenerator.cxx | |
parent | fd59f9ad519c1c311c54569133797d9061e90558 (diff) | |
download | CMake-a354f60ce07cd67bd60161824a4e74bf9068fea4.zip CMake-a354f60ce07cd67bd60161824a4e74bf9068fea4.tar.gz CMake-a354f60ce07cd67bd60161824a4e74bf9068fea4.tar.bz2 |
Refactor extra generator registration to use factories
This will allow additional information about the availability
and capabilities of extra generators to be queried without
actually creating them.
Instead of a static NewFactory() method like the main generator
factories have, use a static GetFactory() method to get a pointer to a
statically allocated extra generator factory. This simplifies memory
management.
Diffstat (limited to 'Source/cmExtraKateGenerator.cxx')
-rw-r--r-- | Source/cmExtraKateGenerator.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index b757a49..4e72504 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -22,24 +22,28 @@ #include <cmsys/SystemTools.hxx> -void cmExtraKateGenerator::GetDocumentation(cmDocumentationEntry& entry, - const std::string&) const +cmExtraKateGenerator::cmExtraKateGenerator() + : cmExternalMakefileProjectGenerator() { - entry.Name = this->GetName(); - entry.Brief = "Generates Kate project files."; } -cmExtraKateGenerator::cmExtraKateGenerator() - : cmExternalMakefileProjectGenerator() +cmExternalMakefileProjectGeneratorFactory* cmExtraKateGenerator::GetFactory() { + static cmExternalMakefileProjectGeneratorSimpleFactory<cmExtraKateGenerator> + factory("Kate", "Generates Kate project files."); + + if (factory.GetSupportedGlobalGenerators().empty()) { #if defined(_WIN32) - this->SupportedGlobalGenerators.push_back("MinGW Makefiles"); - this->SupportedGlobalGenerators.push_back("NMake Makefiles"); + factory.AddSupportedGlobalGenerator("MinGW Makefiles"); + factory.AddSupportedGlobalGenerator("NMake Makefiles"); // disable until somebody actually tests it: -// this->SupportedGlobalGenerators.push_back("MSYS Makefiles"); +// factory.AddSupportedGlobalGenerator("MSYS Makefiles"); #endif - this->SupportedGlobalGenerators.push_back("Ninja"); - this->SupportedGlobalGenerators.push_back("Unix Makefiles"); + factory.AddSupportedGlobalGenerator("Ninja"); + factory.AddSupportedGlobalGenerator("Unix Makefiles"); + } + + return &factory; } void cmExtraKateGenerator::Generate() |