cmExtraCodeBlocksGenerator.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
  22. {
  23. public:
  24. cmExtraCodeBlocksGenerator();
  25. virtual const char* GetName() const
  26. { return cmExtraCodeBlocksGenerator::GetActualName();}
  27. static const char* 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 char* fullName) const;
  33. virtual void Generate();
  34. private:
  35. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  36. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  37. const std::string& filename);
  38. std::string GetCBCompilerId(const cmMakefile* mf);
  39. int GetCBTargetType(cmTarget* target);
  40. std::string BuildMakeCommand(const std::string& make, const char* makefile,
  41. const char* target);
  42. void AppendTarget(cmGeneratedFileStream& fout,
  43. const char* targetName,
  44. cmTarget* target,
  45. const char* make,
  46. const cmMakefile* makefile,
  47. const char* compiler);
  48. };
  49. #endif