diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-11-19 10:48:19 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-11-19 19:40:32 (GMT) |
commit | 1c2752169c3d34b80fb331b4edcc31a6001d2974 (patch) | |
tree | 69fdfd7c58f23db6aec345ba97959a5339c94ea7 | |
parent | 37554acf43f1a94f22b3b9fb8838d685ffa07194 (diff) | |
download | CMake-1c2752169c3d34b80fb331b4edcc31a6001d2974.zip CMake-1c2752169c3d34b80fb331b4edcc31a6001d2974.tar.gz CMake-1c2752169c3d34b80fb331b4edcc31a6001d2974.tar.bz2 |
cmGlobalGenerator: Make NameResolvesToFramework const.
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 4 |
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 */ |