cmGlobalGenerator: Split creation of generator object from initialization.

This commit is contained in:
Stephen Kelly 2015-07-25 19:58:20 +02:00
parent a8e5d838ed
commit 0e0258c8b9
2 changed files with 15 additions and 1 deletions

View File

@ -1242,6 +1242,7 @@ void cmGlobalGenerator::Generate()
// Create per-target generator information. // Create per-target generator information.
this->CreateGeneratorTargets(); this->CreateGeneratorTargets();
this->InitGeneratorTargets();
#ifdef CMAKE_BUILD_WITH_CMAKE #ifdef CMAKE_BUILD_WITH_CMAKE
for (AutogensType::iterator it = autogens.begin(); it != autogens.end(); for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
@ -1471,7 +1472,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
{ {
cmTarget* t = &ti->second; cmTarget* t = &ti->second;
cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
this->ComputeTargetObjectDirectory(gt);
this->GeneratorTargets[t] = gt; this->GeneratorTargets[t] = gt;
generatorTargets[t] = gt; generatorTargets[t] = gt;
} }
@ -1487,6 +1487,19 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
mf->SetGeneratorTargets(generatorTargets); mf->SetGeneratorTargets(generatorTargets);
} }
//----------------------------------------------------------------------------
void cmGlobalGenerator::InitGeneratorTargets()
{
for(cmGeneratorTargetsType::iterator ti =
this->GeneratorTargets.begin(); ti != this->GeneratorTargets.end(); ++ti)
{
if (!ti->second->Target->IsImported())
{
this->ComputeTargetObjectDirectory(ti->second);
}
}
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets() void cmGlobalGenerator::CreateGeneratorTargets()
{ {

View File

@ -485,6 +485,7 @@ private:
cmGeneratorTargetsType GeneratorTargets; cmGeneratorTargetsType GeneratorTargets;
friend class cmake; friend class cmake;
void CreateGeneratorTargets(cmLocalGenerator* lg); void CreateGeneratorTargets(cmLocalGenerator* lg);
void InitGeneratorTargets();
void CreateGeneratorTargets(); void CreateGeneratorTargets();
void ClearGeneratorMembers(); void ClearGeneratorMembers();