cmExtraCodeBlocksGenerator.h 2.5 KB

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