summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-19 11:23:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-06-19 11:23:40 (GMT)
commit631fe145e68cddd98fb42636833549d14113aa0d (patch)
tree2e2457da327a27dc87fb936417b0f78975090e03 /Source
parenta5d44570832414be3879a8e77f6079811619f1fc (diff)
parent5d8f1a8421367aab8fc81b43a8f999862aa42190 (diff)
downloadCMake-631fe145e68cddd98fb42636833549d14113aa0d.zip
CMake-631fe145e68cddd98fb42636833549d14113aa0d.tar.gz
CMake-631fe145e68cddd98fb42636833549d14113aa0d.tar.bz2
Merge topic 'generated_export_remove_duplicate_required_cmake_lines'
5d8f1a8421 Export: A singular CMake version written for interface targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3458
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportBuildFileGenerator.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 012355b..3fe84a9 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -45,6 +45,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
std::string expectedTargets;
std::string sep;
std::vector<std::string> targets;
+ bool generatedInterfaceRequired = false;
this->GetTargets(targets);
for (std::string const& tei : targets) {
cmGeneratorTarget* te = this->LG->FindGeneratorTargetToUse(tei);
@@ -60,11 +61,13 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
this->LG->GetMakefile()->GetBacktrace());
return false;
}
- if (this->GetExportTargetType(te) == cmStateEnums::INTERFACE_LIBRARY) {
- this->GenerateRequiredCMakeVersion(os, "3.0.0");
- }
+ generatedInterfaceRequired |=
+ this->GetExportTargetType(te) == cmStateEnums::INTERFACE_LIBRARY;
}
+ if (generatedInterfaceRequired) {
+ this->GenerateRequiredCMakeVersion(os, "3.0.0");
+ }
this->GenerateExpectedTargetsCode(os, expectedTargets);
}