diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-13 08:53:27 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-02-24 15:43:23 (GMT) |
commit | 21e91350b06b562ac2668c6ff2a3b220e41d4bc1 (patch) | |
tree | 805309eb8ae8679d3c2f0fc4effa0acaa781bd52 /Source/cmTarget.cxx | |
parent | f81eb49e8be851cef5e75a5074ff46435c941301 (diff) | |
download | CMake-21e91350b06b562ac2668c6ff2a3b220e41d4bc1.zip CMake-21e91350b06b562ac2668c6ff2a3b220e41d4bc1.tar.gz CMake-21e91350b06b562ac2668c6ff2a3b220e41d4bc1.tar.bz2 |
cmTarget: Change GetTransitivePropertyLinkLibraries to output targets.
The callers already skip non-targets, so unify the target search.
Change supporting functions to accept a container of targets instead
of strings where possible.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 5fa9276..faf53c1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -5213,10 +5213,9 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config, } //---------------------------------------------------------------------------- -void cmTarget::GetTransitivePropertyLinkLibraries( - const char* config, +void cmTarget::GetTransitivePropertyTargets(const char* config, cmTarget const* headTarget, - std::vector<std::string> &libs) const + std::vector<cmTarget*> &tgts) const { cmTarget::LinkInterface const* iface = this->GetLinkInterface(config, headTarget); @@ -5228,7 +5227,15 @@ void cmTarget::GetTransitivePropertyLinkLibraries( || this->GetPolicyStatusCMP0022() == cmPolicies::WARN || this->GetPolicyStatusCMP0022() == cmPolicies::OLD) { - libs = iface->Libraries; + for(std::vector<std::string>::const_iterator it = iface->Libraries.begin(); + it != iface->Libraries.end(); ++it) + { + if (cmTarget* tgt = headTarget->GetMakefile() + ->FindTargetToUse(it->c_str())) + { + tgts.push_back(tgt); + } + } return; } @@ -5246,12 +5253,23 @@ void cmTarget::GetTransitivePropertyLinkLibraries( cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(), linkIfaceProp, 0, 0); dagChecker.SetTransitivePropertiesOnly(); + std::vector<std::string> libs; cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate( this->Makefile, config, false, headTarget, this, &dagChecker), libs); + + for(std::vector<std::string>::const_iterator it = libs.begin(); + it != libs.end(); ++it) + { + if (cmTarget* tgt = headTarget->GetMakefile() + ->FindTargetToUse(it->c_str())) + { + tgts.push_back(tgt); + } + } } //---------------------------------------------------------------------------- |