diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 9533319e96..29f67436f0 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -107,6 +107,10 @@ cmExportBuildFileGenerator std::vector missingTargets; this->SetImportDetailProperties(config, suffix, target, properties, missingTargets); + this->SetImportLinkInterface(config, suffix, + cmGeneratorExpression::BuildInterface, + target, properties, missingTargets); + // TOOD: PUBLIC_HEADER_LOCATION // This should wait until the build feature propagation stuff diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index df8f3e8d16..5e5f45509b 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -344,6 +344,26 @@ cmExportFileGenerator::ResolveTargetsInGeneratorExpression( } } +//---------------------------------------------------------------------------- +void +cmExportFileGenerator +::SetImportLinkInterface(const char* config, std::string const& suffix, + cmGeneratorExpression::PreprocessContext preprocessRule, + cmTarget* target, ImportPropertyMap& properties, + std::vector& missingTargets) +{ + // Add the transitive link dependencies for this configuration. + cmTarget::LinkInterface const* iface = target->GetLinkInterface(config, + target); + if (!iface) + { + return; + } + this->SetImportLinkProperty(suffix, target, + "IMPORTED_LINK_INTERFACE_LIBRARIES", + iface->Libraries, properties, missingTargets); +} + //---------------------------------------------------------------------------- void cmExportFileGenerator @@ -388,9 +408,7 @@ cmExportFileGenerator this->SetImportLinkProperty(suffix, target, "IMPORTED_LINK_INTERFACE_LANGUAGES", iface->Languages, properties, missingTargets); - this->SetImportLinkProperty(suffix, target, - "IMPORTED_LINK_INTERFACE_LIBRARIES", - iface->Libraries, properties, missingTargets); + this->SetImportLinkProperty(suffix, target, "IMPORTED_LINK_DEPENDENT_LIBRARIES", iface->SharedDeps, properties, missingTargets); diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 866806b66e..4d97a63388 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -102,6 +102,10 @@ protected: void GenerateInterfaceProperties(cmTarget *target, std::ostream& os, const ImportPropertyMap &properties); + void SetImportLinkInterface(const char* config, std::string const& suffix, + cmGeneratorExpression::PreprocessContext preprocessRule, + cmTarget* target, ImportPropertyMap& properties, + std::vector& missingTargets); enum FreeTargetsReplace { ReplaceFreeTargets, diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index bc953c9c1d..68881a1681 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -229,6 +229,10 @@ cmExportInstallFileGenerator this->SetImportDetailProperties(config, suffix, te->Target, properties, missingTargets); + this->SetImportLinkInterface(config, suffix, + cmGeneratorExpression::InstallInterface, + te->Target, properties, missingTargets); + // TOOD: PUBLIC_HEADER_LOCATION // This should wait until the build feature propagation stuff // is done. Then this can be a propagated include directory.