cmExtraCodeBlocksGenerator.h 1.6 KB

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