cmExtraCodeBlocksGenerator.h 2.3 KB

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