diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-02-19 14:49:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-25 13:20:19 (GMT) |
commit | 16c687825daef4008d52b9b68bfa603ba493ac03 (patch) | |
tree | c627348d23d8745d1c9e9643ca0d4da699d5319d /Source/cmQtAutoGenInitializer.h | |
parent | 2d291667582dc8129ed1c3c4e7d7333f3b8627f4 (diff) | |
download | CMake-16c687825daef4008d52b9b68bfa603ba493ac03.zip CMake-16c687825daef4008d52b9b68bfa603ba493ac03.tar.gz CMake-16c687825daef4008d52b9b68bfa603ba493ac03.tar.bz2 |
Autogen: Refactor file lists computation
In AUTOGEN this replaces simple file name lists with two list (for
headers and sources) of structs with file name and file flags.
The file name lists that are passed to the _autogen target via
AutogenInfo.cmake are filtered from these two lists.
Diffstat (limited to 'Source/cmQtAutoGenInitializer.h')
-rw-r--r-- | Source/cmQtAutoGenInitializer.h | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index e2bbac0..a8c7960 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -8,15 +8,18 @@ #include "cmQtAutoGen.h" #include <map> +#include <memory> // IWYU pragma: keep #include <ostream> #include <set> #include <string> +#include <unordered_map> #include <utility> #include <vector> class cmGeneratorTarget; class cmTarget; class cmQtAutoGenGlobalInitializer; +class cmSourceFile; /// @brief Initializes the QtAutoGen generators class cmQtAutoGenInitializer : public cmQtAutoGen @@ -40,6 +43,19 @@ public: std::vector<std::string> Resources; }; + /// @brief Moc/Uic file + struct MUFile + { + std::string RealPath; + cmSourceFile* SF = nullptr; + bool Generated = false; + bool SkipMoc = false; + bool SkipUic = false; + bool MocIt = false; + bool UicIt = false; + }; + typedef std::unique_ptr<MUFile> MUFileHandle; + /// @brief Abstract moc/uic/rcc generator variables base class struct GenVarsT { @@ -109,6 +125,12 @@ public: bool SetupCustomTargets(); private: + /// @brief If moc or uic is enabled, the autogen target will be generated + bool MocOrUicEnabled() const + { + return (this->Moc.Enabled || this->Uic.Enabled); + } + bool InitMoc(); bool InitUic(); bool InitRcc(); @@ -144,6 +166,8 @@ private: std::vector<std::string> ConfigsList; std::string Verbosity; std::string TargetsFolder; + bool CMP0071Accept = false; + bool CMP0071Warn = false; /// @brief Common directories struct @@ -171,17 +195,15 @@ private: std::set<std::string> DependFiles; std::set<cmTarget*> DependTargets; // Sources to process - std::vector<std::string> Headers; - std::vector<std::string> Sources; - std::vector<std::string> HeadersGenerated; - std::vector<std::string> SourcesGenerated; + std::unordered_map<cmSourceFile*, MUFileHandle> Headers; + std::unordered_map<cmSourceFile*, MUFileHandle> Sources; + std::vector<MUFile*> FilesGenerated; } AutogenTarget; /// @brief Moc only variables struct MocT : public GenVarsT { std::string PredefsCmd; - std::set<std::string> Skip; std::vector<std::string> Includes; std::map<std::string, std::vector<std::string>> ConfigIncludes; std::set<std::string> Defines; @@ -197,7 +219,7 @@ private: /// @brief Uic only variables struct UicT : public GenVarsT { - std::set<std::string> Skip; + std::set<std::string> SkipUi; std::vector<std::string> SearchPaths; std::vector<std::string> Options; std::map<std::string, std::vector<std::string>> ConfigOptions; |