From b2054e1661e5c607cf25e1ac127982f58e29dd44 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 5 Oct 2015 19:21:59 +0200 Subject: [PATCH] QtAutogen: Port global generator to cmGeneratorTarget. --- Source/cmGlobalGenerator.cxx | 26 ++++++++++++++------------ Source/cmGlobalGenerator.h | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 53c859da3..21ada7133 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1251,7 +1251,7 @@ bool cmGlobalGenerator::Compute() #ifdef CMAKE_BUILD_WITH_CMAKE // Iterate through all targets and set up automoc for those which have // the AUTOMOC, AUTOUIC or AUTORCC property set - std::vector autogenTargets = + std::vector autogenTargets = this->CreateQtAutoGeneratorsTargets(); #endif @@ -1264,10 +1264,10 @@ bool cmGlobalGenerator::Compute() } #ifdef CMAKE_BUILD_WITH_CMAKE - for (std::vector::iterator it = autogenTargets.begin(); - it != autogenTargets.end(); ++it) + for (std::vector::iterator it = + autogenTargets.begin(); it != autogenTargets.end(); ++it) { - cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*it); + cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget((*it)->Target); } #endif @@ -1403,17 +1403,17 @@ bool cmGlobalGenerator::ComputeTargetDepends() } //---------------------------------------------------------------------------- -std::vector +std::vector cmGlobalGenerator::CreateQtAutoGeneratorsTargets() { - std::vector autogenTargets; + std::vector autogenTargets; #ifdef CMAKE_BUILD_WITH_CMAKE for(unsigned int i=0; i < this->LocalGenerators.size(); ++i) { cmTargets& targets = this->LocalGenerators[i]->GetMakefile()->GetTargets(); - std::vector filteredTargets; + std::vector filteredTargets; filteredTargets.reserve(targets.size()); for(cmTargets::iterator ti = targets.begin(); ti != targets.end(); ++ti) @@ -1449,16 +1449,18 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() continue; } - cmQtAutoGeneratorInitializer::InitializeAutogenSources(&ti->second); - filteredTargets.push_back(&ti->second); + cmGeneratorTarget* gt = this->GetGeneratorTarget(&ti->second); + + cmQtAutoGeneratorInitializer::InitializeAutogenSources(gt->Target); + filteredTargets.push_back(gt); } - for(std::vector::iterator ti = filteredTargets.begin(); + for(std::vector::iterator ti = filteredTargets.begin(); ti != filteredTargets.end(); ++ti) { - cmTarget* target = *ti; + cmTarget* target = (*ti)->Target; cmQtAutoGeneratorInitializer::InitializeAutogenTarget( this->LocalGenerators[i], target); - autogenTargets.push_back(target); + autogenTargets.push_back(*ti); } } #endif diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index ba74c9e65..25e06cda9 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -384,7 +384,7 @@ protected: virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const; - std::vector CreateQtAutoGeneratorsTargets(); + std::vector CreateQtAutoGeneratorsTargets(); std::string SelectMakeProgram(const std::string& makeProgram, const std::string& makeDefault = "") const;