summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx48
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6b5cb97..5928fb5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2196,6 +2196,25 @@ cmTarget* cmGlobalGenerator::FindTargetImpl(std::string const& name) const
return 0;
}
+cmGeneratorTarget*
+cmGlobalGenerator::FindGeneratorTargetImpl(std::string const& name) const
+{
+ for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ std::vector<cmGeneratorTarget*> tgts =
+ this->LocalGenerators[i]->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+ it != tgts.end(); ++it)
+ {
+ if ((*it)->GetName() == name)
+ {
+ return *it;
+ }
+ }
+ }
+ return 0;
+}
+
cmTarget*
cmGlobalGenerator::FindImportedTargetImpl(std::string const& name) const
{
@@ -2215,6 +2234,25 @@ cmGlobalGenerator::FindImportedTargetImpl(std::string const& name) const
return 0;
}
+cmGeneratorTarget* cmGlobalGenerator::FindImportedGeneratorTargetImpl(
+ std::string const& name) const
+{
+ for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ std::vector<cmGeneratorTarget*> tgts =
+ this->LocalGenerators[i]->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+ it != tgts.end(); ++it)
+ {
+ if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
+ {
+ return *it;
+ }
+ }
+ }
+ return 0;
+}
+
//----------------------------------------------------------------------------
cmTarget*
cmGlobalGenerator::FindTarget(const std::string& name,
@@ -2236,6 +2274,16 @@ cmGlobalGenerator::FindTarget(const std::string& name,
return this->FindImportedTargetImpl(name);
}
+cmGeneratorTarget*
+cmGlobalGenerator::FindGeneratorTarget(const std::string& name) const
+{
+ if (cmGeneratorTarget* tgt = this->FindGeneratorTargetImpl(name))
+ {
+ return tgt;
+ }
+ return this->FindImportedGeneratorTargetImpl(name);
+}
+
//----------------------------------------------------------------------------
bool
cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const