Commit af3d3b88 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

export: Only generate and install configuration files if needed.

The modern way to create configuration dependent content is using
generator expressions in the main export file.  The only non-deprecated
property still generated in the configuration-specific files are

INTERFACE_LIBRARY targets have no location, and no need for those
parent 0de81bba
......@@ -115,12 +115,17 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
bool require2_8_12 = false;
bool require3_0_0 = false;
bool requiresConfigFiles = false;
// Create all the imported targets.
tei = allTargets.begin();
tei != allTargets.end(); ++tei)
cmTarget* te = (*tei)->Target;
requiresConfigFiles = requiresConfigFiles
|| te->GetType() != cmTarget::INTERFACE_LIBRARY;
this->GenerateImportTargetCode(os, te);
ImportPropertyMap properties;
......@@ -197,8 +202,11 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
// Generate an import file for each configuration.
bool result = true;
// Generate an import file for each configuration.
// Don't do this if we only export INTERFACE_LIBRARY targets.
if (requiresConfigFiles)
ci = this->Configurations.begin();
ci != this->Configurations.end(); ++ci)
......@@ -208,6 +216,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
result = false;
this->GenerateMissingTargetsCheckCode(os, missingTargets);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment