cmExtraCodeBlocksGenerator.h 1.76 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4 5
#ifndef cmExtraCodeBlocksGenerator_h
#define cmExtraCodeBlocksGenerator_h

6
#include "cmConfigure.h" // IWYU pragma: keep
7

8 9
#include "cmExternalMakefileProjectGenerator.h"

10 11 12 13
#include <string>
#include <vector>

class cmGeneratorTarget;
14 15
class cmLocalGenerator;
class cmMakefile;
16
class cmXMLWriter;
17 18 19 20 21 22 23 24 25

/** \class cmExtraCodeBlocksGenerator
 * \brief Write CodeBlocks project files for Makefile based projects
 */
class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
{
public:
  cmExtraCodeBlocksGenerator();

26
  static cmExternalMakefileProjectGeneratorFactory* GetFactory();
27

28
  void Generate() override;
29

30
private:
31 32
  struct CbpUnit
  {
33
    std::vector<const cmGeneratorTarget*> Targets;
34
  };
35 36 37 38

  void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);

  void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
39
                            const std::string& filename);
40
  std::string CreateDummyTargetFile(cmLocalGenerator* lg,
41
                                    cmGeneratorTarget* target) const;
42

43
  std::string GetCBCompilerId(const cmMakefile* mf);
44
  int GetCBTargetType(cmGeneratorTarget* target);
45 46
  std::string BuildMakeCommand(const std::string& make,
                               const std::string& makefile,
47 48
                               const std::string& target,
                               const std::string& makeFlags);
49
  void AppendTarget(cmXMLWriter& xml, const std::string& targetName,
50 51
                    cmGeneratorTarget* target, const std::string& make,
                    const cmLocalGenerator* lg, const std::string& compiler,
52
                    const std::string& makeFlags);
53 54 55
};

#endif