/src/CMake/Source/cmQtAutoGenGlobalInitializer.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <map> |
8 | | #include <memory> |
9 | | #include <string> |
10 | | #include <unordered_map> |
11 | | #include <vector> |
12 | | |
13 | | #include "cmQtAutoGen.h" |
14 | | |
15 | | class cmLocalGenerator; |
16 | | class cmQtAutoGenInitializer; |
17 | | |
18 | | /// @brief Initializes the QtAutoGen generators |
19 | | class cmQtAutoGenGlobalInitializer |
20 | | { |
21 | | public: |
22 | | /// @brief Collection of QtAutogen related keywords |
23 | | class Keywords |
24 | | { |
25 | | public: |
26 | | Keywords(); |
27 | | |
28 | | std::string AUTOMOC; |
29 | | std::string AUTOUIC; |
30 | | std::string AUTORCC; |
31 | | |
32 | | std::string AUTOMOC_EXECUTABLE; |
33 | | std::string AUTOUIC_EXECUTABLE; |
34 | | std::string AUTORCC_EXECUTABLE; |
35 | | |
36 | | std::string SKIP_AUTOGEN; |
37 | | std::string SKIP_AUTOMOC; |
38 | | std::string SKIP_AUTOUIC; |
39 | | std::string SKIP_AUTORCC; |
40 | | |
41 | | std::string AUTOUIC_OPTIONS; |
42 | | std::string AUTORCC_OPTIONS; |
43 | | |
44 | | std::string qrc; |
45 | | std::string ui; |
46 | | }; |
47 | | |
48 | | cmQtAutoGenGlobalInitializer( |
49 | | std::vector<std::unique_ptr<cmLocalGenerator>> const& localGenerators); |
50 | | ~cmQtAutoGenGlobalInitializer(); |
51 | | |
52 | 0 | Keywords const& kw() const { return this->Keywords_; } |
53 | | |
54 | | bool InitializeCustomTargets(); |
55 | | bool SetupCustomTargets(); |
56 | | |
57 | | private: |
58 | | friend class cmQtAutoGenInitializer; |
59 | | |
60 | | void GetOrCreateGlobalTarget(cmLocalGenerator* localGen, |
61 | | std::string const& name, |
62 | | std::string const& comment); |
63 | | |
64 | | void AddToGlobalAutoGen(cmLocalGenerator* localGen, |
65 | | std::string const& targetName); |
66 | | void AddToGlobalAutoRcc(cmLocalGenerator* localGen, |
67 | | std::string const& targetName); |
68 | | |
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); |
74 | | |
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_; |
82 | | }; |