cmQtAutoGenInitializer.h 3.2 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
#ifndef cmQtAutoGenInitializer_h
#define cmQtAutoGenInitializer_h
5

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

9
10
#include <map>
#include <set>
11
#include <string>
12
#include <vector>
13

14
class cmGeneratorTarget;
15

16
/// @brief Initializes the QtAutoGen generators
17
class cmQtAutoGenInitializer : public cmQtAutoGen
18
19
{
public:
20
21
  static std::string GetQtMajorVersion(cmGeneratorTarget const* target);
  static std::string GetQtMinorVersion(cmGeneratorTarget const* target,
22
                                       std::string const& qtVersionMajor);
23

24
  /// @brief Rcc job information
25
26
27
28
29
30
31
32
33
34
  class Qrc
  {
  public:
    Qrc()
      : Generated(false)
      , Unique(false)
    {
    }

  public:
35
    std::string LockFile;
36
37
38
39
40
41
42
43
44
45
46
47
48
    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:
49
50
51
  cmQtAutoGenInitializer(cmGeneratorTarget* target, bool mocEnabled,
                         bool uicEnabled, bool rccEnabled,
                         std::string const& qtVersionMajor);
52

53
54
  bool InitCustomTargets();
  bool SetupCustomTargets();
55
56

private:
57
58
  bool SetupCustomTargetsMoc();
  bool SetupCustomTargetsUic();
59

60
  void AddGeneratedSource(std::string const& filename, GeneratorT genType);
61
62
63
64

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

65
66
67
68
  bool GetMocExecutable();
  bool GetUicExecutable();
  bool GetRccExecutable();

69
70
71
72
  bool RccListInputs(std::string const& fileName,
                     std::vector<std::string>& files,
                     std::string& errorMessage);

73
74
private:
  cmGeneratorTarget* Target;
75
  bool MultiConfig;
76
  // Qt
77
78
79
80
81
  std::string QtVersionMajor;
  std::string QtVersionMinor;
  // Configurations
  std::string ConfigDefault;
  std::vector<std::string> ConfigsList;
82
  std::string Parallel;
83
  std::string Verbosity;
84
85
86
87
88
89
90
91
92
93
94
95
  // 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;
96
  // Moc
97
98
99
100
101
102
103
104
105
106
107
  struct
  {
    bool Enabled;
    std::string Executable;
    std::string PredefsCmd;
    std::set<std::string> Skip;
    std::string Includes;
    std::map<std::string, std::string> ConfigIncludes;
    std::string Defines;
    std::map<std::string, std::string> ConfigDefines;
  } Moc;
108
  // Uic
109
110
111
112
113
114
115
116
117
118
119
  struct
  {
    bool Enabled;
    std::string Executable;
    std::set<std::string> Skip;
    std::vector<std::string> SearchPaths;
    std::string Options;
    std::map<std::string, std::string> ConfigOptions;
    std::vector<std::string> FileFiles;
    std::vector<std::vector<std::string>> FileOptions;
  } Uic;
120
  // Rcc
121
122
123
124
125
126
127
  struct
  {
    bool Enabled;
    std::string Executable;
    std::vector<std::string> ListOptions;
    std::vector<Qrc> Qrcs;
  } Rcc;
128
129
130
};

#endif