cmExtraCodeBlocksGenerator.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmExtraCodeBlocksGenerator_h
  4. #define cmExtraCodeBlocksGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmExternalMakefileProjectGenerator.h"
  7. #include <string>
  8. #include <vector>
  9. class cmGeneratorTarget;
  10. class cmLocalGenerator;
  11. class cmMakefile;
  12. class cmXMLWriter;
  13. /** \class cmExtraCodeBlocksGenerator
  14. * \brief Write CodeBlocks project files for Makefile based projects
  15. */
  16. class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
  17. {
  18. public:
  19. cmExtraCodeBlocksGenerator();
  20. static cmExternalMakefileProjectGeneratorFactory* GetFactory();
  21. void Generate() override;
  22. private:
  23. struct CbpUnit
  24. {
  25. std::vector<const cmGeneratorTarget*> Targets;
  26. };
  27. void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
  28. void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
  29. const std::string& filename);
  30. std::string CreateDummyTargetFile(cmLocalGenerator* lg,
  31. cmGeneratorTarget* target) const;
  32. std::string GetCBCompilerId(const cmMakefile* mf);
  33. int GetCBTargetType(cmGeneratorTarget* target);
  34. std::string BuildMakeCommand(const std::string& make,
  35. const std::string& makefile,
  36. const std::string& target,
  37. const std::string& makeFlags);
  38. void AppendTarget(cmXMLWriter& xml, const std::string& targetName,
  39. cmGeneratorTarget* target, const std::string& make,
  40. const cmLocalGenerator* lg, const std::string& compiler,
  41. const std::string& makeFlags);
  42. };
  43. #endif