diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 1c15bd3ca..19b3e16d6 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1098,10 +1098,20 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode if (std::find_if(transBegin, transEnd, cmStrCmp(propertyName)) != transEnd) { - std::vector tgts; - target->GetTransitivePropertyTargets(context->Config, - headTarget, tgts); + if(cmTarget::LinkInterfaceLibraries const* iface = + target->GetLinkInterfaceLibraries(context->Config, headTarget, true)) + { + for(std::vector::const_iterator + it = iface->Libraries.begin(); + it != iface->Libraries.end(); ++it) + { + if (it->Target) + { + tgts.push_back(it->Target); + } + } + } if (!tgts.empty()) { linkedTargetsContent = diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b36a600a8..8185bcc2c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6054,25 +6054,6 @@ cmTarget::GetLinkImplementationClosure(const std::string& config) const return tgts; } -//---------------------------------------------------------------------------- -void cmTarget::GetTransitivePropertyTargets(const std::string& config, - cmTarget const* headTarget, - std::vector &tgts) const -{ - if(cmTarget::LinkInterfaceLibraries const* iface = - this->GetLinkInterfaceLibraries(config, headTarget, true)) - { - for(std::vector::const_iterator it = iface->Libraries.begin(); - it != iface->Libraries.end(); ++it) - { - if (it->Target) - { - tgts.push_back(it->Target); - } - } - } -} - //---------------------------------------------------------------------------- void cmTargetInternals::ComputeLinkInterfaceLibraries( diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 8e21d4fbc..12712725c 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -296,9 +296,6 @@ public: GetLinkInterfaceLibraries(const std::string& config, cmTarget const* headTarget, bool usage_requirements_only) const; - void GetTransitivePropertyTargets(const std::string& config, - cmTarget const* headTarget, - std::vector &libs) const; std::vector const& GetLinkImplementationClosure(const std::string& config) const;