packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmExtraCodeBlocksGenerator.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2004-2009 Kitware, Inc.
4   Copyright 2004 Alexander Neundorf (neundorf@kde.org)
5
6   Distributed under the OSI-approved BSD License (the "License");
7   see accompanying file Copyright.txt for details.
8
9   This software is distributed WITHOUT ANY WARRANTY; without even the
10   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11   See the License for more information.
12 ============================================================================*/
13 #ifndef cmExtraCodeBlocksGenerator_h
14 #define cmExtraCodeBlocksGenerator_h
15
16 #include "cmExternalMakefileProjectGenerator.h"
17
18 class cmLocalGenerator;
19 class cmMakefile;
20 class cmTarget;
21 class cmGeneratedFileStream;
22
23 /** \class cmExtraCodeBlocksGenerator
24  * \brief Write CodeBlocks project files for Makefile based projects
25  */
26 class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
27 {
28 public:
29   cmExtraCodeBlocksGenerator();
30
31   virtual const char* GetName() const
32                          { return cmExtraCodeBlocksGenerator::GetActualName();}
33   static const char* GetActualName()                    { return "CodeBlocks";}
34   static cmExternalMakefileProjectGenerator* New()
35                                      { return new cmExtraCodeBlocksGenerator; }
36   /** Get the documentation entry for this generator.  */
37   virtual void GetDocumentation(cmDocumentationEntry& entry,
38                                 const char* fullName) const;
39
40   virtual void Generate();
41 private:
42
43   void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
44
45   void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
46                                 const std::string& filename);
47   std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
48
49   std::string GetCBCompilerId(const cmMakefile* mf);
50   int GetCBTargetType(cmTarget* target);
51   std::string BuildMakeCommand(const std::string& make, const char* makefile,
52                                const char* target);
53   void AppendTarget(cmGeneratedFileStream& fout,
54                     const char* targetName,
55                     cmTarget* target,
56                     const char* make,
57                     const cmMakefile* makefile,
58                     const char* compiler);
59
60 };
61
62 #endif