diff options
author | Brad King <brad.king@kitware.com> | 2018-09-10 13:42:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-12 16:46:51 (GMT) |
commit | f9cb6f618a72b0aa129006b79311f1fa7c9197bc (patch) | |
tree | df0c4bf0d1a8646697ebc3bacb5f67f4cb1b92ec /Source/cmExportFileGenerator.cxx | |
parent | 18441a626901ec559d3ebaed7fd99f09360c5b39 (diff) | |
download | CMake-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.cxx | 9 |
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; |