diff options
-rw-r--r-- | Source/cmQtAutoGen.cxx | 46 | ||||
-rw-r--r-- | Source/cmQtAutoGen.h | 9 | ||||
-rw-r--r-- | Source/cmQtAutoGenGlobalInitializer.cxx | 6 | ||||
-rw-r--r-- | Source/cmQtAutoGenGlobalInitializer.h | 4 |
4 files changed, 28 insertions, 37 deletions
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx index 87ef112..d71d82f 100644 --- a/Source/cmQtAutoGen.cxx +++ b/Source/cmQtAutoGen.cxx @@ -73,44 +73,44 @@ void MergeOptions(std::vector<std::string>& baseOpts, unsigned int const cmQtAutoGen::ParallelMax = 64; std::string const cmQtAutoGen::ListSep = "<<<S>>>"; -std::string const cmQtAutoGen::GenAutoGen = "AutoGen"; -std::string const cmQtAutoGen::GenAutoMoc = "AutoMoc"; -std::string const cmQtAutoGen::GenAutoUic = "AutoUic"; -std::string const cmQtAutoGen::GenAutoRcc = "AutoRcc"; - -std::string const cmQtAutoGen::GenAUTOGEN = "AUTOGEN"; -std::string const cmQtAutoGen::GenAUTOMOC = "AUTOMOC"; -std::string const cmQtAutoGen::GenAUTOUIC = "AUTOUIC"; -std::string const cmQtAutoGen::GenAUTORCC = "AUTORCC"; - std::string const& cmQtAutoGen::GeneratorName(GenT genType) { + static const std::string AutoGen("AutoGen"); + static const std::string AutoMoc("AutoMoc"); + static const std::string AutoUic("AutoUic"); + static const std::string AutoRcc("AutoRcc"); + switch (genType) { case GenT::GEN: - return GenAutoGen; + return AutoGen; case GenT::MOC: - return GenAutoMoc; + return AutoMoc; case GenT::UIC: - return GenAutoUic; + return AutoUic; case GenT::RCC: - return GenAutoRcc; + return AutoRcc; } - return GenAutoGen; + return AutoGen; } std::string const& cmQtAutoGen::GeneratorNameUpper(GenT genType) { + static const std::string AUTOGEN("AUTOGEN"); + static const std::string AUTOMOC("AUTOMOC"); + static const std::string AUTOUIC("AUTOUIC"); + static const std::string AUTORCC("AUTORCC"); + switch (genType) { case GenT::GEN: - return GenAUTOGEN; + return AUTOGEN; case GenT::MOC: - return GenAUTOMOC; + return AUTOMOC; case GenT::UIC: - return GenAUTOUIC; + return AUTOUIC; case GenT::RCC: - return GenAUTORCC; + return AUTORCC; } - return GenAUTOGEN; + return AUTOGEN; } std::string cmQtAutoGen::Tools(bool moc, bool uic, bool rcc) @@ -118,13 +118,13 @@ std::string cmQtAutoGen::Tools(bool moc, bool uic, bool rcc) std::string res; std::vector<std::string> lst; if (moc) { - lst.emplace_back(GenAUTOMOC); + lst.emplace_back("AUTOMOC"); } if (uic) { - lst.emplace_back(GenAUTOUIC); + lst.emplace_back("AUTOUIC"); } if (rcc) { - lst.emplace_back(GenAUTORCC); + lst.emplace_back("AUTORCC"); } switch (lst.size()) { case 1: diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h index 6cc8df1..d127a71 100644 --- a/Source/cmQtAutoGen.h +++ b/Source/cmQtAutoGen.h @@ -51,15 +51,6 @@ public: /// @brief Nested lists separator static std::string const ListSep; - // Generator names - static std::string const GenAutoGen; - static std::string const GenAutoMoc; - static std::string const GenAutoUic; - static std::string const GenAutoRcc; - static std::string const GenAUTOGEN; - static std::string const GenAUTOMOC; - static std::string const GenAUTOUIC; - static std::string const GenAUTORCC; /// @brief Maximum number of parallel threads/processes in a generator static unsigned int const ParallelMax; diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx index 994cfc8..ab51570 100644 --- a/Source/cmQtAutoGenGlobalInitializer.cxx +++ b/Source/cmQtAutoGenGlobalInitializer.cxx @@ -81,9 +81,9 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer( continue; } - bool const moc = target->GetPropertyAsBool(cmQtAutoGen::GenAUTOMOC); - bool const uic = target->GetPropertyAsBool(cmQtAutoGen::GenAUTOUIC); - bool const rcc = target->GetPropertyAsBool(cmQtAutoGen::GenAUTORCC); + bool const moc = target->GetPropertyAsBool(kw().AUTOMOC); + bool const uic = target->GetPropertyAsBool(kw().AUTOUIC); + bool const rcc = target->GetPropertyAsBool(kw().AUTORCC); if (moc || uic || rcc) { std::string const mocExec = target->GetSafeProperty("AUTOMOC_EXECUTABLE"); diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h index 6cddf16..76ed76b 100644 --- a/Source/cmQtAutoGenGlobalInitializer.h +++ b/Source/cmQtAutoGenGlobalInitializer.h @@ -34,7 +34,7 @@ public: std::vector<cmLocalGenerator*> const& localGenerators); ~cmQtAutoGenGlobalInitializer(); - Keywords const* kw() const { return Keywords_.get(); }; + Keywords const& kw() const { return Keywords_; }; bool generate(); @@ -62,7 +62,7 @@ private: std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_; std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_; std::unordered_map<std::string, std::string> ExecutableTestOutputs_; - std::unique_ptr<Keywords> Keywords_; + Keywords const Keywords_; }; #endif |