mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 14:40:26 -06:00
Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
This property is generated only for targets which have recorded policy CMP0022 as NEW, and a compatibility mode is added to additionally export the old interfaces in that case too. If the old interfaces are not exported, the generated export files require CMake 2.8.12. Because the unit tests use a version which is not yet called 2.8.12, temporarily require a lower version.
This commit is contained in:
@@ -113,6 +113,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
|
||||
std::vector<std::string> missingTargets;
|
||||
|
||||
bool require2_8_12 = false;
|
||||
// Create all the imported targets.
|
||||
for(std::vector<cmTarget*>::const_iterator
|
||||
tei = allTargets.begin();
|
||||
@@ -134,6 +135,20 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
te,
|
||||
cmGeneratorExpression::InstallInterface,
|
||||
properties, missingTargets);
|
||||
|
||||
const bool newCMP0022Behavior =
|
||||
te->GetPolicyStatusCMP0022() != cmPolicies::WARN
|
||||
&& te->GetPolicyStatusCMP0022() != cmPolicies::OLD;
|
||||
if (newCMP0022Behavior)
|
||||
{
|
||||
if (this->PopulateInterfaceLinkLibrariesProperty(te,
|
||||
cmGeneratorExpression::InstallInterface,
|
||||
properties, missingTargets)
|
||||
&& !this->ExportOld)
|
||||
{
|
||||
require2_8_12 = true;
|
||||
}
|
||||
}
|
||||
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
|
||||
te, properties);
|
||||
this->PopulateCompatibleInterfaceProperties(te, properties);
|
||||
@@ -141,6 +156,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
this->GenerateInterfaceProperties(te, os, properties);
|
||||
}
|
||||
|
||||
if (require2_8_12)
|
||||
{
|
||||
this->GenerateRequiredCMakeVersion(os, "2.8.11.20130626");
|
||||
}
|
||||
|
||||
// Now load per-configuration properties for them.
|
||||
os << "# Load information for each installed configuration.\n"
|
||||
|
||||
Reference in New Issue
Block a user