cmExtraCodeBlocksGenerator.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. static cmExternalMakefileProjectGeneratorFactory* GetFactory();
  26. void Generate() CM_OVERRIDE;
  27. private:
  28. struct CbpUnit
  29. {
  30. std::vector<const cmGeneratorTarget*> Targets;
  31. };
  32. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  33. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  34. const std::string& filename);
  35. std::string CreateDummyTargetFile(cmLocalGenerator* lg,
  36. cmGeneratorTarget* target) const;
  37. std::string GetCBCompilerId(const cmMakefile* mf);
  38. int GetCBTargetType(cmGeneratorTarget* target);
  39. std::string BuildMakeCommand(const std::string& make, const char* makefile,
  40. const std::string& target,
  41. const std::string& makeFlags);
  42. void AppendTarget(cmXMLWriter& xml, const std::string& targetName,
  43. cmGeneratorTarget* target, const char* make,
  44. const cmLocalGenerator* lg, const char* compiler,
  45. const std::string& makeFlags);
  46. };
  47. #endif