summaryrefslogtreecommitdiff
path: root/Source/cmGlobalGeneratorFactory.h
diff options
context:
space:
mode:
authorPatrick Gansterer <paroga@paroga.com>2012-11-19 16:13:54 +0100
committerBrad King <brad.king@kitware.com>2012-11-19 12:54:35 -0500
commit04ff866ca8a0c5f4f8712d6cfafcd192ed4cbe58 (patch)
tree690d285ba132f07a4189cf68564f962aae7cd158 /Source/cmGlobalGeneratorFactory.h
parent984ebc3350f72cb005999f7b796803f83be15304 (diff)
downloadcmake-04ff866ca8a0c5f4f8712d6cfafcd192ed4cbe58.tar.gz
Allow a GeneratorFactory handling of more than one generator
Pass the name of the requested generator to the generator factory, which is now responsible to check if it can create a matching generator for the name. This allows us to add more logic to the factory in a next step, so that not every possible generator needs to get registered explicit in cmake::AddDefaultGenerators().
Diffstat (limited to 'Source/cmGlobalGeneratorFactory.h')
-rw-r--r--Source/cmGlobalGeneratorFactory.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index 9d8f7a0855..0dfb36240e 100644
--- a/Source/cmGlobalGeneratorFactory.h
+++ b/Source/cmGlobalGeneratorFactory.h
@@ -29,7 +29,7 @@ public:
virtual ~cmGlobalGeneratorFactory() {}
/** Create a GlobalGenerator */
- virtual cmGlobalGenerator* CreateGlobalGenerator() const = 0;
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const char* n) const = 0;
/** Get the documentation entry for this factory */
virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0;
@@ -43,7 +43,8 @@ class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory
{
public:
/** Create a GlobalGenerator */
- virtual cmGlobalGenerator* CreateGlobalGenerator() const {
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
+ if (strcmp(name, T::GetActualName())) return 0;
return new T; }
/** Get the documentation entry for this factory */