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:
Tobias Hunger
2016-07-20 18:28:39 +02:00
committed by Brad King
parent fd59f9ad51
commit a354f60ce0
16 changed files with 282 additions and 241 deletions

View File

@@ -28,18 +28,7 @@ class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
public:
cmExtraCodeBlocksGenerator();
std::string GetName() const CM_OVERRIDE
{
return cmExtraCodeBlocksGenerator::GetActualName();
}
static std::string GetActualName() { return "CodeBlocks"; }
static cmExternalMakefileProjectGenerator* New()
{
return new cmExtraCodeBlocksGenerator;
}
/** Get the documentation entry for this generator. */
void GetDocumentation(cmDocumentationEntry& entry,
const std::string& fullName) const CM_OVERRIDE;
static cmExternalMakefileProjectGeneratorFactory* GetFactory();
void Generate() CM_OVERRIDE;