From 0e0258c8b9c6cab7c55c90687b30d65a83783c2f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 25 Jul 2015 19:58:20 +0200 Subject: cmGlobalGenerator: Split creation of generator object from initialization. --- Source/cmGlobalGenerator.cxx | 15 ++++++++++++++- Source/cmGlobalGenerator.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index fcb5998..45ef399 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1242,6 +1242,7 @@ void cmGlobalGenerator::Generate() // Create per-target generator information. this->CreateGeneratorTargets(); + this->InitGeneratorTargets(); #ifdef CMAKE_BUILD_WITH_CMAKE for (AutogensType::iterator it = autogens.begin(); it != autogens.end(); @@ -1471,7 +1472,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg) { cmTarget* t = &ti->second; cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); - this->ComputeTargetObjectDirectory(gt); this->GeneratorTargets[t] = gt; generatorTargets[t] = gt; } @@ -1488,6 +1488,19 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg) } //---------------------------------------------------------------------------- +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() { // Construct per-target generator information. diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 398335b..b9a32bf 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -485,6 +485,7 @@ private: cmGeneratorTargetsType GeneratorTargets; friend class cmake; void CreateGeneratorTargets(cmLocalGenerator* lg); + void InitGeneratorTargets(); void CreateGeneratorTargets(); void ClearGeneratorMembers(); -- cgit v0.12