Sfoglia il codice sorgente

Rename local target lookup methods to clarify purpose

Rename methods:

* `cmMakefile::Find{ => LocalNonAlias}Target`
* `cmLocalGenerator::Find{ => LocalNonAlias}GeneratorTarget`

These names clarify that they are for directory-local target names
and do not consider alias targets.
Brad King 9 anni fa
parent
commit
0e44f4894f

+ 1 - 1
Source/cmFLTKWrapUICommand.cxx

@@ -117,7 +117,7 @@ void cmFLTKWrapUICommand::FinalPass()
   // people should add the srcs to the target themselves, but the old command
   // didn't support that, so check and see if they added the files in and if
   // they didn;t then print a warning and add then anyhow
-  cmTarget* target = this->Makefile->FindTarget(this->Target);
+  cmTarget* target = this->Makefile->FindLocalNonAliasTarget(this->Target);
   if(!target)
     {
     std::string msg =

+ 1 - 1
Source/cmInstallCommand.cxx

@@ -381,7 +381,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
       return false;
       }
     // Lookup this target in the current directory.
-    if(cmTarget* target=this->Makefile->FindTarget(*targetIt))
+    if(cmTarget* target=this->Makefile->FindLocalNonAliasTarget(*targetIt))
       {
       // Found the target.  Check its type.
       if(target->GetType() != cmState::EXECUTABLE &&

+ 1 - 1
Source/cmInstallTargetGenerator.cxx

@@ -446,7 +446,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmGeneratorTarget const* target,
 
 void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg)
 {
-  this->Target = lg->FindGeneratorTarget(this->TargetName);
+  this->Target = lg->FindLocalNonAliasGeneratorTarget(this->TargetName);
 }
 
 //----------------------------------------------------------------------------

+ 2 - 2
Source/cmLocalGenerator.cxx

@@ -485,7 +485,7 @@ private:
   std::string Name;
 };
 
-cmGeneratorTarget* cmLocalGenerator::FindGeneratorTarget(
+cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget(
     const std::string& name) const
 {
   std::vector<cmGeneratorTarget*>::const_iterator ti =
@@ -1828,7 +1828,7 @@ cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const
     return *imported;
     }
 
-  if(cmGeneratorTarget* t = this->FindGeneratorTarget(name))
+  if(cmGeneratorTarget* t = this->FindLocalNonAliasGeneratorTarget(name))
     {
     return t;
     }

+ 2 - 1
Source/cmLocalGenerator.h

@@ -129,7 +129,8 @@ public:
   void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
   void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt);
 
-  cmGeneratorTarget* FindGeneratorTarget(const std::string& name) const;
+  cmGeneratorTarget*
+    FindLocalNonAliasGeneratorTarget(const std::string& name) const;
   cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
 
   /**

+ 2 - 2
Source/cmMakefile.cxx

@@ -4058,7 +4058,7 @@ std::vector<std::string> cmMakefile::GetPropertyKeys() const
   return this->StateSnapshot.GetDirectory().GetPropertyKeys();
 }
 
-cmTarget* cmMakefile::FindTarget(const std::string& name) const
+cmTarget* cmMakefile::FindLocalNonAliasTarget(const std::string& name) const
 {
   cmTargets::iterator i = this->Targets.find( name );
   if ( i != this->Targets.end() )
@@ -4235,7 +4235,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name,
     }
 
   // Look for a target built in this directory.
-  if(cmTarget* t = this->FindTarget(name))
+  if(cmTarget* t = this->FindLocalNonAliasTarget(name))
     {
     return t;
     }

+ 1 - 1
Source/cmMakefile.h

@@ -388,7 +388,7 @@ public:
     }
   std::vector<cmTarget*> GetImportedTargets() const;
 
-  cmTarget* FindTarget(const std::string& name) const;
+  cmTarget* FindLocalNonAliasTarget(const std::string& name) const;
 
   /** Find a target to use in place of the given name.  The target
       returned may be imported or built within the project.  */