/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 <unordered_set> |
12 | | #include <vector> |
13 | | |
14 | | #include "cmQtAutoGen.h" |
15 | | |
16 | | class cmLocalGenerator; |
17 | | class cmQtAutoGenInitializer; |
18 | | |
19 | | /// @brief Initializes the QtAutoGen generators |
20 | | class cmQtAutoGenGlobalInitializer |
21 | | { |
22 | | public: |
23 | | /// @brief Collection of QtAutogen related keywords |
24 | | class Keywords |
25 | | { |
26 | | public: |
27 | | Keywords(); |
28 | | |
29 | | std::string AUTOMOC; |
30 | | std::string AUTOUIC; |
31 | | std::string AUTORCC; |
32 | | |
33 | | std::string AUTOMOC_EXECUTABLE; |
34 | | std::string AUTOUIC_EXECUTABLE; |
35 | | std::string AUTORCC_EXECUTABLE; |
36 | | |
37 | | std::string SKIP_AUTOGEN; |
38 | | std::string SKIP_AUTOMOC; |
39 | | std::string SKIP_AUTOUIC; |
40 | | std::string SKIP_AUTORCC; |
41 | | |
42 | | std::string AUTOUIC_OPTIONS; |
43 | | std::string AUTORCC_OPTIONS; |
44 | | |
45 | | std::string qrc; |
46 | | std::string ui; |
47 | | }; |
48 | | |
49 | | cmQtAutoGenGlobalInitializer( |
50 | | std::vector<std::unique_ptr<cmLocalGenerator>> const& localGenerators); |
51 | | ~cmQtAutoGenGlobalInitializer(); |
52 | | |
53 | 0 | Keywords const& kw() const { return this->Keywords_; } |
54 | | |
55 | | bool InitializeCustomTargets(); |
56 | | bool SetupCustomTargets(); |
57 | | |
58 | | private: |
59 | | friend class cmQtAutoGenInitializer; |
60 | | |
61 | | void GetOrCreateGlobalTarget(cmLocalGenerator* localGen, |
62 | | std::string const& name, |
63 | | std::string const& comment); |
64 | | |
65 | | void AddToGlobalAutoGen(cmLocalGenerator* localGen, |
66 | | std::string const& targetName); |
67 | | void AddToGlobalAutoRcc(cmLocalGenerator* localGen, |
68 | | std::string const& targetName); |
69 | | |
70 | | /// @brief Check whether a file exists, using a cached listing of its |
71 | | /// directory to rule out files that do not exist without querying |
72 | | /// the file system for each of them. |
73 | | bool CachedFileExists(std::string const& path); |
74 | | |
75 | | cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> |
76 | | GetCompilerFeatures(std::string const& generator, |
77 | | cmQtAutoGen::ConfigString const& executable, |
78 | | std::string& error, bool isMultiConfig, |
79 | | bool UseBetterGraph); |
80 | | |
81 | | std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_; |
82 | | std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_; |
83 | | std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_; |
84 | | cmQtAutoGen::ConfigStrings< |
85 | | std::unordered_map<std::string, cmQtAutoGen::CompilerFeaturesHandle>> |
86 | | CompilerFeatures_; |
87 | | Keywords const Keywords_; |
88 | | /// Lower case names in directories, see CachedFileExists. |
89 | | std::unordered_map<std::string, std::unordered_set<std::string>> |
90 | | DirectoryNames_; |
91 | | }; |