cmInstallTargetGenerator: Get a cmGeneratorTarget directly.

Extend the cmGeneratorTarget API to make this possible.
This commit is contained in:
Stephen Kelly 2015-10-18 23:49:12 +02:00
parent c2c239e607
commit a6b7eb5bc8
3 changed files with 9 additions and 2 deletions

View File

@ -440,8 +440,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target,
void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg)
{ {
this->Target = lg->GetGlobalGenerator()->GetGeneratorTarget( this->Target = lg->FindGeneratorTarget(this->TargetName);
lg->GetMakefile()->FindTarget(this->TargetName));
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -453,6 +453,13 @@ void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt)
this->GeneratorTargets.push_back(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() void cmLocalGenerator::ComputeTargetManifest()
{ {

View File

@ -120,6 +120,7 @@ public:
void AddGeneratorTarget(cmGeneratorTarget* gt); void AddGeneratorTarget(cmGeneratorTarget* gt);
cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const; cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
/** /**