cmExtraCodeBlocksGenerator.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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, const char* makefile,
  35. const std::string& target,
  36. const std::string& makeFlags);
  37. void AppendTarget(cmXMLWriter& xml, const std::string& targetName,
  38. cmGeneratorTarget* target, const char* make,
  39. const cmLocalGenerator* lg, const char* compiler,
  40. const std::string& makeFlags);
  41. };
  42. #endif