diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-25 12:14:44 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-27 06:44:26 (GMT) |
commit | c389f8bb07e900d805ca3163f47b06e3dbe4303b (patch) | |
tree | 777213ec086fdf40af7f0835d4cce2c21a2694a2 /Source/cmLocalGenerator.cxx | |
parent | 02533038dae9fb5b4ae1b6f7d55bb5af397400af (diff) | |
download | CMake-c389f8bb07e900d805ca3163f47b06e3dbe4303b.zip CMake-c389f8bb07e900d805ca3163f47b06e3dbe4303b.tar.gz CMake-c389f8bb07e900d805ca3163f47b06e3dbe4303b.tar.bz2 |
cmLocalGenerator: Port Find method away from GetGeneratorTarget
Mirror the cmMakefile::FindTarget method.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1bc7f81..ec7c29f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1821,11 +1821,21 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, cmGeneratorTarget* cmLocalGenerator::FindGeneratorTargetToUse(const std::string& name) const { - if (cmTarget *t = this->Makefile->FindTargetToUse(name)) + std::vector<cmGeneratorTarget*>::const_iterator + imported = std::find_if(this->ImportedGeneratorTargets.begin(), + this->ImportedGeneratorTargets.end(), + NamedGeneratorTargetFinder(name)); + if(imported != this->ImportedGeneratorTargets.end()) { - return this->GetGlobalGenerator()->GetGeneratorTarget(t); + return *imported; } - return 0; + + if(cmGeneratorTarget* t = this->FindGeneratorTarget(name)) + { + return t; + } + + return this->GetGlobalGenerator()->FindGeneratorTarget(name); } //---------------------------------------------------------------------------- |