cmExtraCodeBlocksGenerator.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 cmGeneratorTarget;
  17. class cmXMLWriter;
  18. /** \class cmExtraCodeBlocksGenerator
  19. * \brief Write CodeBlocks project files for Makefile based projects
  20. */
  21. class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
  22. {
  23. public:
  24. cmExtraCodeBlocksGenerator();
  25. virtual std::string GetName() const
  26. { return cmExtraCodeBlocksGenerator::GetActualName();}
  27. static std::string GetActualName() { return "CodeBlocks";}
  28. static cmExternalMakefileProjectGenerator* New()
  29. { return new cmExtraCodeBlocksGenerator; }
  30. /** Get the documentation entry for this generator. */
  31. virtual void GetDocumentation(cmDocumentationEntry& entry,
  32. const std::string& fullName) const;
  33. virtual void Generate();
  34. private:
  35. struct CbpUnit
  36. {
  37. std::vector<const cmGeneratorTarget*> Targets;
  38. };
  39. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  40. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  41. const std::string& filename);
  42. std::string CreateDummyTargetFile(cmLocalGenerator* lg,
  43. cmGeneratorTarget* target) const;
  44. std::string GetCBCompilerId(const cmMakefile* mf);
  45. int GetCBTargetType(cmGeneratorTarget* target);
  46. std::string BuildMakeCommand(const std::string& make, const char* makefile,
  47. const std::string& target,
  48. const std::string& makeFlags);
  49. void AppendTarget(cmXMLWriter& xml,
  50. const std::string& targetName,
  51. cmGeneratorTarget* target,
  52. const char* make,
  53. const cmLocalGenerator* lg,
  54. const char* compiler,
  55. const std::string& makeFlags
  56. );
  57. };
  58. #endif