summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-08 16:39:22 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:34 (GMT)
commit8d60da0cb56b44815f02ece01e224e1f4eba6c80 (patch)
tree0005425533e1ee87ef7decefafd40fa7921ded14 /Source
parent23e9b80f585db1cc68846a54e6e5844f970215ea (diff)
downloadCMake-8d60da0cb56b44815f02ece01e224e1f4eba6c80.zip
CMake-8d60da0cb56b44815f02ece01e224e1f4eba6c80.tar.gz
CMake-8d60da0cb56b44815f02ece01e224e1f4eba6c80.tar.bz2
cmTarget: Remove the project argument to FindTarget
All callers passed 0 in, so just remove the branch.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportCommand.cxx2
-rw-r--r--Source/cmExportLibraryDependenciesCommand.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx51
-rw-r--r--Source/cmGlobalGenerator.h2
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmMakefile.cxx5
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx2
-rw-r--r--Source/cmTargetPropCommandBase.cxx2
9 files changed, 25 insertions, 45 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index db56aaf..bda8dda 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -168,7 +168,7 @@ bool cmExportCommand
return false;
}
- if(cmTarget* target = gg->FindTarget(0, currentTarget->c_str()))
+ if(cmTarget* target = gg->FindTarget(currentTarget->c_str()))
{
if(target->GetType() == cmTarget::OBJECT_LIBRARY)
{
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index 5d6f094..469a661 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -138,7 +138,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
break;
}
std::string lib = li->first;
- if(cmTarget* libtgt = global->FindTarget(0, lib.c_str()))
+ if(cmTarget* libtgt = global->FindTarget(lib.c_str()))
{
// Handle simple output name changes. This command is
// deprecated so we do not support full target name
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ae9c731..ba4cce8 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2070,47 +2070,28 @@ bool cmGlobalGenerator::IsAlias(const std::string& name) const
//----------------------------------------------------------------------------
cmTarget*
-cmGlobalGenerator::FindTarget(const char* project, const std::string& name,
+cmGlobalGenerator::FindTarget(const std::string& name,
bool excludeAliases) const
{
- // if project specific
- if(project)
+ if (!excludeAliases)
{
- std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
- gens = this->ProjectMap.find(project);
- for(unsigned int i = 0; i < gens->second.size(); ++i)
+ std::map<cmStdString, cmTarget*>::const_iterator ai
+ = this->AliasTargets.find(name);
+ if (ai != this->AliasTargets.end())
{
- cmTarget* ret = (gens->second)[i]->GetMakefile()->FindTarget(name,
- excludeAliases);
- if(ret)
- {
- return ret;
- }
+ return ai->second;
}
}
- // if all projects/directories
- else
+ std::map<cmStdString,cmTarget *>::const_iterator i =
+ this->TotalTargets.find ( name );
+ if ( i != this->TotalTargets.end() )
{
- if (!excludeAliases)
- {
- std::map<cmStdString, cmTarget*>::const_iterator ai
- = this->AliasTargets.find(name);
- if (ai != this->AliasTargets.end())
- {
- return ai->second;
- }
- }
- std::map<cmStdString,cmTarget *>::const_iterator i =
- this->TotalTargets.find ( name );
- if ( i != this->TotalTargets.end() )
- {
- return i->second;
- }
- i = this->ImportedTargets.find(name);
- if ( i != this->ImportedTargets.end() )
- {
- return i->second;
- }
+ return i->second;
+ }
+ i = this->ImportedTargets.find(name);
+ if ( i != this->ImportedTargets.end() )
+ {
+ return i->second;
}
return 0;
}
@@ -2124,7 +2105,7 @@ cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
return true;
}
- if(cmTarget* tgt = this->FindTarget(0, libname.c_str()))
+ if(cmTarget* tgt = this->FindTarget(libname.c_str()))
{
if(tgt->IsFrameworkOnApple())
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ce285d6..746f715 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -211,7 +211,7 @@ public:
virtual void FindMakeProgram(cmMakefile*);
///! Find a target by name by searching the local generators.
- cmTarget* FindTarget(const char* project, const std::string& name,
+ cmTarget* FindTarget(const std::string& name,
bool excludeAliases = false) const;
void AddAlias(const std::string& name, cmTarget *tgt);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 1ba74eb..51825ee 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -440,7 +440,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
target.GetUtilities().begin();
ui != target.GetUtilities().end(); ++ui)
{
- if(cmTarget* depTarget = this->FindTarget(0, ui->c_str()))
+ if(cmTarget* depTarget = this->FindTarget(ui->c_str()))
{
if(depTarget->GetType() != cmTarget::INTERFACE_LIBRARY
&& depTarget->GetProperty("EXTERNAL_MSPROJECT"))
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 88206f1..a5ac629 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1099,7 +1099,7 @@ void cmLocalVisualStudio6Generator
// Compute the proper name to use to link this library.
std::string lib;
std::string libDebug;
- cmTarget* tgt = this->GlobalGenerator->FindTarget(0, j->first.c_str());
+ cmTarget* tgt = this->GlobalGenerator->FindTarget(j->first.c_str());
if(tgt)
{
lib = cmSystemTools::GetFilenameWithoutExtension
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8584ad8..a94e39c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1471,7 +1471,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
if ( i != this->Targets.end())
{
cmTarget* tgt =
- this->GetCMakeInstance()->GetGlobalGenerator()->FindTarget(0,lib);
+ this->GetCMakeInstance()->GetGlobalGenerator()->FindTarget(lib);
if(tgt)
{
// if it is not a static or shared library then you can not link to it
@@ -4068,8 +4068,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name,
}
// Look for a target built in this project.
- return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0,
- name.c_str(),
+ return this->LocalGenerator->GetGlobalGenerator()->FindTarget(name.c_str(),
excludeAliases);
}
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 02da933..b16f311 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -39,7 +39,7 @@ bool cmTargetLinkLibrariesCommand
// Lookup the target for which libraries are specified.
this->Target =
this->Makefile->GetCMakeInstance()
- ->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
+ ->GetGlobalGenerator()->FindTarget(args[0].c_str());
if(!this->Target)
{
cmake::MessageType t = cmake::FATAL_ERROR; // fail by default
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 2a20516..1a1cfa0 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -34,7 +34,7 @@ bool cmTargetPropCommandBase
}
this->Target =
this->Makefile->GetCMakeInstance()
- ->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
+ ->GetGlobalGenerator()->FindTarget(args[0].c_str());
if(!this->Target)
{
this->Target = this->Makefile->FindTargetToUse(args[0]);