cmExtraCodeBlocksGenerator.h 2.3 KB

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