Răsfoiți Sursa

cmInstallTargetGenerator: Get a cmGeneratorTarget directly.

Extend the cmGeneratorTarget API to make this possible.
Stephen Kelly 10 ani în urmă
părinte
comite
a6b7eb5bc8

+ 1 - 2
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);
 }
 
 //----------------------------------------------------------------------------

+ 7 - 0
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()
 {

+ 1 - 0
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;
 
   /**