cmGlobalGenerator: Make NameResolvesToFramework const.

This commit is contained in:
Stephen Kelly 2013-11-19 11:48:19 +01:00
parent 37554acf43
commit 1c2752169c
2 changed files with 11 additions and 9 deletions

View File

@ -1989,15 +1989,16 @@ bool cmGlobalGenerator::IsAlias(const char *name) const
//----------------------------------------------------------------------------
cmTarget*
cmGlobalGenerator::FindTarget(const char* project, const char* name,
bool excludeAliases)
bool excludeAliases) const
{
// if project specific
if(project)
{
std::vector<cmLocalGenerator*>* gens = &this->ProjectMap[project];
for(unsigned int i = 0; i < gens->size(); ++i)
std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
gens = this->ProjectMap.find(project);
for(unsigned int i = 0; i < gens->second.size(); ++i)
{
cmTarget* ret = (*gens)[i]->GetMakefile()->FindTarget(name,
cmTarget* ret = (gens->second)[i]->GetMakefile()->FindTarget(name,
excludeAliases);
if(ret)
{
@ -2010,14 +2011,14 @@ cmGlobalGenerator::FindTarget(const char* project, const char* name,
{
if (!excludeAliases)
{
std::map<cmStdString, cmTarget*>::iterator ai
std::map<cmStdString, cmTarget*>::const_iterator ai
= this->AliasTargets.find(name);
if (ai != this->AliasTargets.end())
{
return ai->second;
}
}
std::map<cmStdString,cmTarget *>::iterator i =
std::map<cmStdString,cmTarget *>::const_iterator i =
this->TotalTargets.find ( name );
if ( i != this->TotalTargets.end() )
{
@ -2033,7 +2034,8 @@ cmGlobalGenerator::FindTarget(const char* project, const char* name,
}
//----------------------------------------------------------------------------
bool cmGlobalGenerator::NameResolvesToFramework(const std::string& libname)
bool
cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
{
if(cmSystemTools::IsPathToFramework(libname.c_str()))
{

View File

@ -207,14 +207,14 @@ public:
///! Find a target by name by searching the local generators.
cmTarget* FindTarget(const char* project, const char* name,
bool excludeAliases = false);
bool excludeAliases = false) const;
void AddAlias(const char *name, cmTarget *tgt);
bool IsAlias(const char *name) const;
/** Determine if a name resolves to a framework on disk or a built target
that is a framework. */
bool NameResolvesToFramework(const std::string& libname);
bool NameResolvesToFramework(const std::string& libname) const;
/** If check to see if the target is linked to by any other
target in the project */