1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
13 #ifndef cmGlobalGeneratorFactory_h
14 #define cmGlobalGeneratorFactory_h
16 #include "cmStandardIncludes.h"
18 class cmGlobalGenerator;
19 struct cmDocumentationEntry;
21 /** \class cmGlobalGeneratorFactory
22 * \brief Responable for creating cmGlobalGenerator instances
24 * Subclasses of this class generate instances of cmGlobalGenerator.
26 class cmGlobalGeneratorFactory
29 virtual ~cmGlobalGeneratorFactory() {}
31 /** Create a GlobalGenerator */
32 virtual cmGlobalGenerator* CreateGlobalGenerator(const char* n) const = 0;
34 /** Get the documentation entry for this factory */
35 virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0;
37 /** Get the names of the current registered generators */
38 virtual void GetGenerators(std::vector<std::string>& names) const = 0;
42 class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory
45 /** Create a GlobalGenerator */
46 virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
47 if (strcmp(name, T::GetActualName())) return 0;
50 /** Get the documentation entry for this factory */
51 virtual void GetDocumentation(cmDocumentationEntry& entry) const {
52 T::GetDocumentation(entry); }
54 /** Get the names of the current registered generators */
55 virtual void GetGenerators(std::vector<std::string>& names) const {
56 names.push_back(T::GetActualName()); }