cmExtraCodeBlocksGenerator.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
  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 std::string& target);
  43. void AppendTarget(cmGeneratedFileStream& fout,
  44. const std::string& targetName,
  45. cmTarget* target,
  46. const char* make,
  47. const cmMakefile* makefile,
  48. const char* compiler);
  49. };
  50. #endif