diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 3589e82c1..20d86a090 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1439,10 +1439,10 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) || target.GetPropertyAsBool("AUTORCC")) && !target.IsImported()) { - cmQtAutoGenerators autogen; - if(autogen.InitializeAutogenTarget(this->LocalGenerators[i], - &target)) + if(cmQtAutoGenerators::InitializeAutogenTarget( + this->LocalGenerators[i], &target)) { + cmQtAutoGenerators autogen; autogens.push_back(std::make_pair(autogen, &target)); } } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 197f92a92..6fee69ed5 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -184,7 +184,7 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target, std::vector& depends) { - std::string rccCommand = this->GetRccExecutable(target); + std::string rccCommand = cmQtAutoGenerators::GetRccExecutable(target); std::vector qrcEntries; std::vector command; @@ -434,11 +434,11 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg, { if (qtMajorVersion == "5") { - this->ListQt5RccInputs(sf, target, depends); + cmQtAutoGenerators::ListQt5RccInputs(sf, target, depends); } else { - this->ListQt4RccInputs(sf, depends); + cmQtAutoGenerators::ListQt4RccInputs(sf, depends); } #if defined(_WIN32) && !defined(__CYGWIN__) // Cannot use PRE_BUILD because the resource files themselves @@ -573,23 +573,24 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target) || target->GetPropertyAsBool("AUTOUIC") || target->GetPropertyAsBool("AUTORCC")) { - this->SetupSourceFiles(target, skipMoc, mocSources, mocHeaders, skipUic); + cmQtAutoGenerators::SetupSourceFiles(target, skipMoc, + mocSources, mocHeaders, skipUic); } makefile->AddDefinition("_cpp_files", cmOutputConverter::EscapeForCMake(cmJoin(mocSources, ";")).c_str()); if (target->GetPropertyAsBool("AUTOMOC")) { - this->SetupAutoMocTarget(target, autogenTargetName, + cmQtAutoGenerators::SetupAutoMocTarget(target, autogenTargetName, skipMoc, mocHeaders, configIncludes, configDefines); } if (target->GetPropertyAsBool("AUTOUIC")) { - this->SetupAutoUicTarget(target, skipUic, configUicOptions); + cmQtAutoGenerators::SetupAutoUicTarget(target, skipUic, configUicOptions); } if (target->GetPropertyAsBool("AUTORCC")) { - this->SetupAutoRccTarget(target); + cmQtAutoGenerators::SetupAutoRccTarget(target); } const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); @@ -1095,7 +1096,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target) { std::vector optsVec; cmSystemTools::ExpandListArgument(prop, optsVec); - this->MergeRccOptions(rccOptions, optsVec, + cmQtAutoGenerators::MergeRccOptions(rccOptions, optsVec, strcmp(qtVersion, "5") == 0); } @@ -1123,11 +1124,12 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target) { if (qtMajorVersion == "5") { - entriesList = this->ListQt5RccInputs(sf, target, depends); + entriesList = cmQtAutoGenerators::ListQt5RccInputs(sf, target, + depends); } else { - entriesList = this->ListQt4RccInputs(sf, depends); + entriesList = cmQtAutoGenerators::ListQt4RccInputs(sf, depends); } if (entriesList.empty()) { @@ -1152,7 +1154,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target) cmOutputConverter::EscapeForCMake(rccFileOptions).c_str()); makefile->AddDefinition("_qt_rcc_executable", - this->GetRccExecutable(target).c_str()); + cmQtAutoGenerators::GetRccExecutable(target).c_str()); } std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target) @@ -2248,7 +2250,8 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName, { std::vector fileOpts; cmSystemTools::ExpandListArgument(optionIt->second, fileOpts); - this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5"); + cmQtAutoGenerators::MergeUicOptions(opts, fileOpts, + this->QtMajorVersion == "5"); } command.insert(command.end(), opts.begin(), opts.end()); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 93ff0ba66..02b6fdf96 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -31,26 +31,26 @@ public: cmQtAutoGenerators(); bool Run(const std::string& targetDirectory, const std::string& config); - bool InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target); - void SetupAutoGenerateTarget(cmTarget const* target); + static bool InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target); + static void SetupAutoGenerateTarget(cmTarget const* target); private: - void SetupSourceFiles(cmTarget const* target, + static void SetupSourceFiles(cmTarget const* target, std::vector& skipMoc, std::vector& mocSources, std::vector& mocHeaders, std::vector& skipUic); - void SetupAutoMocTarget(cmTarget const* target, + static void SetupAutoMocTarget(cmTarget const* target, const std::string &autogenTargetName, const std::vector& skipMoc, const std::vector& mocHeaders, std::map &configIncludes, std::map &configDefines); - void SetupAutoUicTarget(cmTarget const* target, + static void SetupAutoUicTarget(cmTarget const* target, const std::vector& skipUic, std::map &configUicOptions); - void SetupAutoRccTarget(cmTarget const* target); + static void SetupAutoRccTarget(cmTarget const* target); bool ReadAutogenInfoFile(cmMakefile* makefile, const std::string& targetDirectory, @@ -96,18 +96,18 @@ private: bool EndsWith(const std::string& str, const std::string& with); bool StartsWith(const std::string& str, const std::string& with); - void MergeUicOptions(std::vector &opts, + static void MergeUicOptions(std::vector &opts, const std::vector &fileOpts, bool isQt5); - void MergeRccOptions(std::vector &opts, + static void MergeRccOptions(std::vector &opts, const std::vector &fileOpts, bool isQt5); - std::string GetRccExecutable(cmTarget const* target); + static std::string GetRccExecutable(cmTarget const* target); - std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target, + static std::string ListQt5RccInputs(cmSourceFile* sf, cmTarget const* target, std::vector& depends); - std::string ListQt4RccInputs(cmSourceFile* sf, + static std::string ListQt4RccInputs(cmSourceFile* sf, std::vector& depends); bool InputFilesNewerThanQrc(const std::string& qrcFile,