summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-20 14:08:47 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-20 14:08:47 (GMT)
commita61025135b1c1ceea9634973b983bd3e47be8bdd (patch)
tree0983911f1bfe28cb95ccee9fd31ff01180ccdd1a /Source/cmGlobalGenerator.cxx
parent6703508a31953dd0ee437ce0623508a01e8b4580 (diff)
parent15eeacefc5aa91a9767a360dbea4fd8a44b8eca6 (diff)
downloadCMake-a61025135b1c1ceea9634973b983bd3e47be8bdd.zip
CMake-a61025135b1c1ceea9634973b983bd3e47be8bdd.tar.gz
CMake-a61025135b1c1ceea9634973b983bd3e47be8bdd.tar.bz2
Merge topic 'constify'
15eeace cmTarget: Trivially make more API const. be9dfb6 cmTarget: Make GetExportMacro const. 0794c13 cmTarget: Make NameResolvesToFramework const. 1c27521 cmGlobalGenerator: Make NameResolvesToFramework const. 37554ac cmMakefile: Make FindTarget const. 8841d73 cmMakefile: Make IsAlias const. 36e31cd cmTarget: Make GetInterfaceLinkLibraries const. 04d398d cmTarget: Make GetTargetSourceFileFlags const. 50d1520 cmTarget: Make custom command accessors API const. 0f87643 cmGeneratorTarget: Make GetIncludeDirectories const.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 56db0ef..20cd15e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1986,7 +1986,7 @@ void cmGlobalGenerator::AddAlias(const char *name, cmTarget *tgt)
}
//----------------------------------------------------------------------------
-bool cmGlobalGenerator::IsAlias(const char *name)
+bool cmGlobalGenerator::IsAlias(const char *name) const
{
return this->AliasTargets.find(name) != this->AliasTargets.end();
}
@@ -1994,15 +1994,16 @@ bool cmGlobalGenerator::IsAlias(const char *name)
//----------------------------------------------------------------------------
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)
{
@@ -2015,14 +2016,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() )
{
@@ -2038,7 +2039,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()))
{
@@ -2412,7 +2414,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
// Store the custom command in the target.
cmCustomCommand cc(0, no_outputs, no_depends, *commandLines, 0,
workingDirectory);
- target.GetPostBuildCommands().push_back(cc);
+ target.AddPostBuildCommand(cc);
target.SetProperty("EchoString", message);
std::vector<std::string>::iterator dit;
for ( dit = depends.begin(); dit != depends.end(); ++ dit )