Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmExternalMakefileProjectGenerator.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
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 ============================================================================*/
12 #ifndef cmExternalMakefileProjectGenerator_h
13 #define cmExternalMakefileProjectGenerator_h
14
15 #include "cmStandardIncludes.h"
16
17 #include "cmDocumentation.h"
18
19 class cmGlobalGenerator;
20
21 /** \class cmExternalMakefileProjectGenerator
22  * \brief Base class for generators for "External Makefile based IDE projects".
23  *
24  * cmExternalMakefileProjectGenerator is a base class for generators
25  * for "external makefile based projects", i.e. IDE projects which work
26  * an already existing makefiles.
27  * See cmGlobalKdevelopGenerator as an example.
28  * After the makefiles have been generated by one of the Makefile
29  * generators, the Generate() method is called and this generator
30  * can iterate over the local generators and/or projects to produce the
31  * project files for the IDE.
32  */
33 class cmExternalMakefileProjectGenerator
34 {
35 public:
36
37   virtual ~cmExternalMakefileProjectGenerator() {}
38
39   ///! Get the name for this generator.
40   virtual const char* GetName() const = 0;
41   /** Get the documentation entry for this generator.  */
42   virtual void GetDocumentation(cmDocumentationEntry& entry,
43                                 const char* fullName) const = 0;
44
45   ///! set the global generator which will generate the makefiles
46   virtual void SetGlobalGenerator(cmGlobalGenerator* generator)
47                                            {this->GlobalGenerator = generator;}
48
49   ///! Return the list of global generators supported by this extra generator
50   const std::vector<std::string>& GetSupportedGlobalGenerators() const
51                                       {return this->SupportedGlobalGenerators;}
52
53   ///! Get the name of the global generator for the given full name
54   const char* GetGlobalGeneratorName(const char* fullName);
55   /** Create a full name from the given global generator name and the
56    * extra generator name
57    */
58   static std::string CreateFullGeneratorName(const char* globalGenerator,
59                                              const char* extraGenerator);
60
61   ///! Generate the project files, the Makefiles have already been generated
62   virtual void Generate() = 0;
63 protected:
64   ///! Contains the names of the global generators support by this generator.
65   std::vector<std::string> SupportedGlobalGenerators;
66   ///! the global generator which creates the makefiles
67   const cmGlobalGenerator* GlobalGenerator;
68 };
69
70 #endif