From a8ee7406a74cbc4d5e341ad33210b8eeb99af48f Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 31 Jan 2018 13:54:37 +0100 Subject: Autogen: Improved multi-config include scheme For multi configuration generators AUTOMOC generates the moc files that are included in `mocs_compilation.cpp` in `AUTOGEN_BUILD_DIR/include_$/`. By doing so each configuration reads different moc files when compiling `mocs_compilation.cpp`. Since we do not (need to) rewrite `mocs_compilation.cpp` on a configuration change anymore, the files also does not need to be recompiled anymore. Not having to rewrite and recompile `mocs_compilation.cpp` on a configuration change anymore was the main objective of this patch. In a similar fashion AUTORCC generates a `qrc_BASE_CMAKE.cpp` file below `AUTOGEN_BUILD_DIR/include_$/` and `qrc_BASE.cpp` becomes a mere wrapper that includes this actuall rcc output file (when using multi configuration generators). The template files `Modules/AutoRccInfo.cmake.in` and `Modules/AutogenInfo.cmake.in` were removed in favor of writing the info `.cmake` files manually. Closes #17230 --- Source/cmQtAutoGenInitializer.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'Source/cmQtAutoGenInitializer.h') diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h index a667017f53..2a47e46a43 100644 --- a/Source/cmQtAutoGenInitializer.h +++ b/Source/cmQtAutoGenInitializer.h @@ -21,6 +21,7 @@ public: static std::string GetQtMinorVersion(cmGeneratorTarget const* target, std::string const& qtVersionMajor); + /// @brief Rcc job information class Qrc { public: @@ -55,8 +56,7 @@ private: void SetupCustomTargetsMoc(); void SetupCustomTargetsUic(); - std::vector AddGeneratedSource(std::string const& filename, - GeneratorT genType); + void AddGeneratedSource(std::string const& filename, GeneratorT genType); bool QtVersionGreaterOrEqual(unsigned long requestMajor, unsigned long requestMinor) const; @@ -70,15 +70,18 @@ private: bool MocEnabled; bool UicEnabled; bool RccEnabled; + bool MultiConfig; // Qt std::string QtVersionMajor; std::string QtVersionMinor; + std::string MocExecutable; + std::string UicExecutable; std::string RccExecutable; std::vector RccListOptions; // Configurations std::string ConfigDefault; std::vector ConfigsList; - MultiConfigT MultiConfig; + std::string Parallel; // Names std::string AutogenTargetName; std::string AutogenFolder; @@ -91,11 +94,21 @@ private: // Sources std::vector Headers; std::vector Sources; + // Moc + std::string MocPredefsCmd; std::set MocSkip; + std::string MocIncludes; + std::map MocIncludesConfig; + std::string MocDefines; + std::map MocDefinesConfig; + // Uic std::set UicSkip; - std::map ConfigMocIncludes; - std::map ConfigMocDefines; - std::map ConfigUicOptions; + std::vector UicSearchPaths; + std::string UicOptions; + std::map UicOptionsConfig; + std::vector UicFileFiles; + std::vector> UicFileOptions; + // Rcc std::vector Qrcs; }; -- cgit v1.2.1