QtAutogen: Simplify generator initialization API.

This commit is contained in:
Stephen Kelly 2015-09-26 17:50:55 +02:00
parent 65ff75d3f5
commit 12f0e13c5f
2 changed files with 12 additions and 14 deletions

View File

@ -1251,8 +1251,8 @@ bool cmGlobalGenerator::Compute()
#ifdef CMAKE_BUILD_WITH_CMAKE #ifdef CMAKE_BUILD_WITH_CMAKE
// Iterate through all targets and set up automoc for those which have // Iterate through all targets and set up automoc for those which have
// the AUTOMOC, AUTOUIC or AUTORCC property set // the AUTOMOC, AUTOUIC or AUTORCC property set
AutogensType autogens; std::vector<cmTarget const*> autogenTargets =
this->CreateQtAutoGeneratorsTargets(autogens); this->CreateQtAutoGeneratorsTargets();
#endif #endif
unsigned int i; unsigned int i;
@ -1266,10 +1266,10 @@ bool cmGlobalGenerator::Compute()
this->InitGeneratorTargets(); this->InitGeneratorTargets();
#ifdef CMAKE_BUILD_WITH_CMAKE #ifdef CMAKE_BUILD_WITH_CMAKE
for (AutogensType::iterator it = autogens.begin(); it != autogens.end(); for (std::vector<cmTarget const*>::iterator it = autogenTargets.begin();
++it) it != autogenTargets.end(); ++it)
{ {
it->first.SetupAutoGenerateTarget(it->second); cmQtAutoGenerators::SetupAutoGenerateTarget(*it);
} }
#endif #endif
@ -1405,8 +1405,11 @@ bool cmGlobalGenerator::ComputeTargetDepends()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens) std::vector<const cmTarget*>
cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
{ {
std::vector<const cmTarget*> autogenTargets;
#ifdef CMAKE_BUILD_WITH_CMAKE #ifdef CMAKE_BUILD_WITH_CMAKE
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i) for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{ {
@ -1458,13 +1461,11 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
->GetMakefile()->FindTarget(*ti, true); ->GetMakefile()->FindTarget(*ti, true);
cmQtAutoGenerators::InitializeAutogenTarget( cmQtAutoGenerators::InitializeAutogenTarget(
this->LocalGenerators[i], target); this->LocalGenerators[i], target);
cmQtAutoGenerators autogen; autogenTargets.push_back(target);
autogens.push_back(std::make_pair(autogen, target));
} }
} }
#else
(void)autogens;
#endif #endif
return autogenTargets;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -41,7 +41,6 @@ class cmTarget;
class cmInstallTargetGenerator; class cmInstallTargetGenerator;
class cmInstallFilesGenerator; class cmInstallFilesGenerator;
class cmExportBuildFileGenerator; class cmExportBuildFileGenerator;
class cmQtAutoGenerators;
/** \class cmGlobalGenerator /** \class cmGlobalGenerator
* \brief Responsible for overseeing the generation process for the entire tree * \brief Responsible for overseeing the generation process for the entire tree
@ -385,9 +384,7 @@ protected:
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const; virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
typedef std::vector<std::pair<cmQtAutoGenerators, std::vector<cmTarget const*> CreateQtAutoGeneratorsTargets();
cmTarget const*> > AutogensType;
void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
std::string SelectMakeProgram(const std::string& makeProgram, std::string SelectMakeProgram(const std::string& makeProgram,
const std::string& makeDefault = "") const; const std::string& makeDefault = "") const;