Merge branch 'release-3.29'
[kiteware-cmake.git] / Source / cmQtAutoGenGlobalInitializer.h
blobc1c4758bd5cb283f17773e4202de86bf0ec4ab52
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
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <map>
8 #include <memory>
9 #include <string>
10 #include <unordered_map>
11 #include <vector>
13 #include "cmQtAutoGen.h"
15 class cmLocalGenerator;
16 class cmQtAutoGenInitializer;
18 /// @brief Initializes the QtAutoGen generators
19 class cmQtAutoGenGlobalInitializer
21 public:
22 /// @brief Collection of QtAutogen related keywords
23 class Keywords
25 public:
26 Keywords();
28 std::string AUTOMOC;
29 std::string AUTOUIC;
30 std::string AUTORCC;
32 std::string AUTOMOC_EXECUTABLE;
33 std::string AUTOUIC_EXECUTABLE;
34 std::string AUTORCC_EXECUTABLE;
36 std::string SKIP_AUTOGEN;
37 std::string SKIP_AUTOMOC;
38 std::string SKIP_AUTOUIC;
39 std::string SKIP_AUTORCC;
41 std::string AUTOUIC_OPTIONS;
42 std::string AUTORCC_OPTIONS;
44 std::string qrc;
45 std::string ui;
48 cmQtAutoGenGlobalInitializer(
49 std::vector<std::unique_ptr<cmLocalGenerator>> const& localGenerators);
50 ~cmQtAutoGenGlobalInitializer();
52 Keywords const& kw() const { return this->Keywords_; }
54 bool InitializeCustomTargets();
55 bool SetupCustomTargets();
57 private:
58 friend class cmQtAutoGenInitializer;
60 void GetOrCreateGlobalTarget(cmLocalGenerator* localGen,
61 std::string const& name,
62 std::string const& comment);
64 void AddToGlobalAutoGen(cmLocalGenerator* localGen,
65 std::string const& targetName);
66 void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
67 std::string const& targetName);
69 cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
70 GetCompilerFeatures(std::string const& generator,
71 cmQtAutoGen::ConfigString const& executable,
72 std::string& error, bool isMultiConfig,
73 bool UseBetterGraph);
75 std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
76 std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
77 std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
78 cmQtAutoGen::ConfigStrings<
79 std::unordered_map<std::string, cmQtAutoGen::CompilerFeaturesHandle>>
80 CompilerFeatures_;
81 Keywords const Keywords_;