diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2019-06-17 21:30:34 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2019-06-17 21:38:46 (GMT) |
commit | 5d8f1a8421367aab8fc81b43a8f999862aa42190 (patch) | |
tree | a3a13c01d1ac5f93f33d2ef19b323ee63a39cf33 /Source/cmExportBuildFileGenerator.cxx | |
parent | d229a095a2d02851b93b6db58cd10799af2a1040 (diff) | |
download | CMake-5d8f1a8421367aab8fc81b43a8f999862aa42190.zip CMake-5d8f1a8421367aab8fc81b43a8f999862aa42190.tar.gz CMake-5d8f1a8421367aab8fc81b43a8f999862aa42190.tar.bz2 |
Export: A singular CMake version written for interface targets
Diffstat (limited to 'Source/cmExportBuildFileGenerator.cxx')
-rw-r--r-- | Source/cmExportBuildFileGenerator.cxx | 9 |
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); } |