diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index a97cc5f92..7a10356a8 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -440,8 +440,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target, void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) { - this->Target = lg->GetGlobalGenerator()->GetGeneratorTarget( - lg->GetMakefile()->FindTarget(this->TargetName)); + this->Target = lg->FindGeneratorTarget(this->TargetName); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 6959e1de4..365847398 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -453,6 +453,13 @@ void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt) this->GeneratorTargets.push_back(gt); } +cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget( + const std::string& name) const +{ + return this->GetGlobalGenerator()->GetGeneratorTarget( + this->Makefile->FindTarget(name)); +} + //---------------------------------------------------------------------------- void cmLocalGenerator::ComputeTargetManifest() { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 137598570..552020baf 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -120,6 +120,7 @@ public: void AddGeneratorTarget(cmGeneratorTarget* gt); + cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const; cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const; /**