summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGeneratorInitializer.h
blob: e06e1c43ba28179d23597a3f792403816ca96c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#ifndef cmQtAutoGeneratorInitializer_h
#define cmQtAutoGeneratorInitializer_h

#include "cmConfigure.h" // IWYU pragma: keep
#include "cmQtAutoGen.h"

#include <map>
#include <set>
#include <string>
#include <vector>

class cmGeneratorTarget;

class cmQtAutoGeneratorInitializer
{
public:
  static std::string GetQtMajorVersion(cmGeneratorTarget const* target);
  static std::string GetQtMinorVersion(cmGeneratorTarget const* target,
                                       std::string const& qtVersionMajor);

  class Qrc
  {
  public:
    Qrc()
      : Generated(false)
      , Unique(false)
    {
    }

  public:
    std::string QrcFile;
    std::string QrcName;
    std::string PathChecksum;
    std::string InfoFile;
    std::string SettingsFile;
    std::string RccFile;
    bool Generated;
    bool Unique;
    std::vector<std::string> Options;
    std::vector<std::string> Resources;
  };

public:
  cmQtAutoGeneratorInitializer(cmGeneratorTarget* target, bool mocEnabled,
                               bool uicEnabled, bool rccEnabled,
                               std::string const& qtVersionMajor);

  void InitCustomTargets();
  void SetupCustomTargets();

private:
  void SetupCustomTargetsMoc();
  void SetupCustomTargetsUic();

  std::vector<std::string> AddGeneratedSource(std::string const& filename,
                                              cmQtAutoGen::Generator genType);

  bool QtVersionGreaterOrEqual(unsigned long requestMajor,
                               unsigned long requestMinor) const;

private:
  cmGeneratorTarget* Target;
  bool MocEnabled;
  bool UicEnabled;
  bool RccEnabled;
  // Qt
  std::string QtVersionMajor;
  std::string QtVersionMinor;
  std::string RccExecutable;
  std::vector<std::string> RccListOptions;
  // Configurations
  std::string ConfigDefault;
  std::vector<std::string> ConfigsList;
  cmQtAutoGen::MultiConfig MultiConfig;
  // Names
  std::string AutogenTargetName;
  std::string AutogenFolder;
  std::string AutogenInfoFile;
  std::string AutogenSettingsFile;
  // Directories
  std::string DirInfo;
  std::string DirBuild;
  std::string DirWork;
  // Sources
  std::vector<std::string> Headers;
  std::vector<std::string> Sources;
  std::set<std::string> MocSkip;
  std::set<std::string> UicSkip;
  std::map<std::string, std::string> ConfigMocIncludes;
  std::map<std::string, std::string> ConfigMocDefines;
  std::map<std::string, std::string> ConfigUicOptions;
  std::vector<Qrc> Qrcs;
};

#endif