diff options
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); } //---------------------------------------------------------------------------- |