summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-10 13:42:19 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-12 16:46:51 (GMT)
commitf9cb6f618a72b0aa129006b79311f1fa7c9197bc (patch)
treedf0c4bf0d1a8646697ebc3bacb5f67f4cb1b92ec /Source/cmExportFileGenerator.cxx
parent18441a626901ec559d3ebaed7fd99f09360c5b39 (diff)
downloadCMake-f9cb6f618a72b0aa129006b79311f1fa7c9197bc.zip
CMake-f9cb6f618a72b0aa129006b79311f1fa7c9197bc.tar.gz
CMake-f9cb6f618a72b0aa129006b79311f1fa7c9197bc.tar.bz2
cmExportFileGenerator: Use cmGeneratorTarget::ResolveTargetReference
Avoid calling `FindGeneratorTargetToUse` directly.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 1c5040a..67df6fd 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -567,14 +567,17 @@ bool cmExportFileGenerator::AddTargetNamespace(
std::string& input, cmGeneratorTarget* target,
std::vector<std::string>& missingTargets)
{
- cmLocalGenerator* lg = target->GetLocalGenerator();
+ cmGeneratorTarget::TargetOrString resolved =
+ target->ResolveTargetReference(input);
- cmGeneratorTarget* tgt = lg->FindGeneratorTargetToUse(input);
+ cmGeneratorTarget* tgt = resolved.Target;
if (!tgt) {
+ input = resolved.String;
return false;
}
if (tgt->IsImported()) {
+ input = tgt->GetName();
return true;
}
if (this->ExportedTargets.find(tgt) != this->ExportedTargets.end()) {
@@ -584,6 +587,8 @@ bool cmExportFileGenerator::AddTargetNamespace(
this->HandleMissingTarget(namespacedTarget, missingTargets, target, tgt);
if (!namespacedTarget.empty()) {
input = namespacedTarget;
+ } else {
+ input = tgt->GetName();
}
}
return true;