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