/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #ifndef cmQtAutoGenInitializer_h #define cmQtAutoGenInitializer_h #include "cmConfigure.h" // IWYU pragma: keep #include "cmQtAutoGen.h" #include #include #include #include class cmGeneratorTarget; class cmTarget; /// @brief Initializes the QtAutoGen generators class cmQtAutoGenInitializer : public cmQtAutoGen { public: static std::string GetQtMajorVersion(cmGeneratorTarget const* target); static std::string GetQtMinorVersion(cmGeneratorTarget const* target, std::string const& qtVersionMajor); /// @brief Rcc job information class Qrc { public: Qrc() : Generated(false) , Unique(false) { } public: std::string LockFile; std::string QrcFile; std::string QrcName; std::string PathChecksum; std::string InfoFile; std::string SettingsFile; std::map ConfigSettingsFile; std::string RccFile; bool Generated; bool Unique; std::vector Options; std::vector Resources; }; public: cmQtAutoGenInitializer(cmGeneratorTarget* target, bool mocEnabled, bool uicEnabled, bool rccEnabled, std::string const& qtVersionMajor); bool InitCustomTargets(); bool SetupCustomTargets(); private: bool InitMoc(); bool InitUic(); bool InitRcc(); bool InitScanFiles(); bool InitAutogenTarget(); bool InitRccTargets(); bool SetupWriteAutogenInfo(); bool SetupWriteRccInfo(); void AddGeneratedSource(std::string const& filename, GeneratorT genType); bool QtVersionGreaterOrEqual(unsigned long requestMajor, unsigned long requestMinor) const; bool GetMocExecutable(); bool GetUicExecutable(); bool GetRccExecutable(); bool RccListInputs(std::string const& fileName, std::vector& files, std::string& errorMessage); private: cmGeneratorTarget* Target; bool MultiConfig = false; // Qt std::string QtVersionMajor; std::string QtVersionMinor; // Configurations std::string ConfigDefault; std::vector ConfigsList; std::string Parallel; std::string Verbosity; // Names std::string AutogenTargetName; std::string AutogenFolder; std::string AutogenInfoFile; std::string AutogenSettingsFile; std::map AutogenConfigSettingsFile; std::set AutogenDependFiles; std::set AutogenDependTargets; // Directories std::string DirInfo; std::string DirBuild; std::string DirWork; std::string DirInclude; std::map DirConfigInclude; // Moc and UIC struct { // Sources std::vector Headers; std::vector Sources; std::vector HeadersGenerated; std::vector SourcesGenerated; } MocUic; // Moc struct { bool Enabled = false; std::string Executable; std::string PredefsCmd; std::set Skip; std::string Includes; std::map ConfigIncludes; std::string Defines; std::map ConfigDefines; std::string MocsCompilation; } Moc; // Uic struct { bool Enabled = false; std::string Executable; std::set Skip; std::vector SearchPaths; std::string Options; std::map ConfigOptions; std::vector FileFiles; std::vector> FileOptions; } Uic; // Rcc struct { bool Enabled = false; std::string Executable; std::vector ListOptions; std::vector Qrcs; } Rcc; }; #endif