mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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.
This commit is contained in:
@@ -25,20 +25,28 @@
|
||||
#include <cmsys/FStream.hxx>
|
||||
#include <cmsys/SystemTools.hxx>
|
||||
|
||||
void cmGlobalKdevelopGenerator::GetDocumentation(cmDocumentationEntry& entry,
|
||||
const std::string&) const
|
||||
{
|
||||
entry.Name = this->GetName();
|
||||
entry.Brief = "Generates KDevelop 3 project files.";
|
||||
}
|
||||
|
||||
cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator()
|
||||
: cmExternalMakefileProjectGenerator()
|
||||
{
|
||||
this->SupportedGlobalGenerators.push_back("Unix Makefiles");
|
||||
}
|
||||
|
||||
cmExternalMakefileProjectGeneratorFactory*
|
||||
cmGlobalKdevelopGenerator::GetFactory()
|
||||
{
|
||||
static cmExternalMakefileProjectGeneratorSimpleFactory<
|
||||
cmGlobalKdevelopGenerator>
|
||||
factory("KDevelop3", "Generates KDevelop 3 project files.");
|
||||
|
||||
if (factory.GetSupportedGlobalGenerators().empty()) {
|
||||
factory.AddSupportedGlobalGenerator("Unix Makefiles");
|
||||
#ifdef CMAKE_USE_NINJA
|
||||
this->SupportedGlobalGenerators.push_back("Ninja");
|
||||
factory.AddSupportedGlobalGenerator("Ninja");
|
||||
#endif
|
||||
|
||||
factory.Aliases.push_back("KDevelop3");
|
||||
}
|
||||
|
||||
return &factory;
|
||||
}
|
||||
|
||||
void cmGlobalKdevelopGenerator::Generate()
|
||||
|
||||
Reference in New Issue
Block a user