summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalGenerator.cxx16
-rw-r--r--Source/cmGlobalGenerator.h4
2 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 2f16e9c..7366c09 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -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()))
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 15bc366..eb720a8 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -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 */