2016-07-12 08:38:28 +02:00
|
|
|
From c376c5bca204a689b5bcfec88291b8bc7f226e7f Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?utf8?q?Christoph=20Gr=C3=BCninger?= <foss@grueninger.de>
|
|
|
|
Date: Sun, 10 Jul 2016 15:35:24 +0200
|
|
|
|
Subject: [PATCH] Do not place CMake version in export files
|
2016-02-20 15:49:22 +01:00
|
|
|
|
2016-07-12 08:38:28 +02:00
|
|
|
Files generated by `install(EXPORT)` and `export_library_dependencies()`
|
|
|
|
may be installed with packages and consumed by dependents. In order to
|
|
|
|
avoid re-building dependents only because the version of CMake changed,
|
|
|
|
drop the CMake version from the export file content.
|
|
|
|
---
|
|
|
|
Source/cmExportFileGenerator.cxx | 2 +-
|
|
|
|
Source/cmExportLibraryDependenciesCommand.cxx | 2 +-
|
|
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
|
|
|
|
index d93e406..e00af5e 100644
|
|
|
|
--- a/Source/cmExportFileGenerator.cxx
|
|
|
|
+++ b/Source/cmExportFileGenerator.cxx
|
|
|
|
@@ -93,7 +93,7 @@ bool cmExportFileGenerator::GenerateImportFile()
|
2016-02-20 15:49:22 +01:00
|
|
|
|
|
|
|
// Protect that file against use with older CMake versions.
|
2016-07-10 11:05:52 +02:00
|
|
|
/* clang-format off */
|
2016-02-20 15:49:22 +01:00
|
|
|
- os << "# Generated by CMake " << cmVersion::GetCMakeVersion() << "\n\n";
|
|
|
|
+ os << "# Generated by CMake\n\n";
|
|
|
|
os << "if(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.5)\n"
|
|
|
|
<< " message(FATAL_ERROR \"CMake >= 2.6.0 required\")\n"
|
|
|
|
<< "endif()\n";
|
2016-07-12 08:38:28 +02:00
|
|
|
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
|
|
|
|
index c8272cb..b422a2c 100644
|
|
|
|
--- a/Source/cmExportLibraryDependenciesCommand.cxx
|
|
|
|
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
|
|
|
|
@@ -152,7 +152,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
|
2016-02-20 15:49:22 +01:00
|
|
|
// versions.
|
|
|
|
const char* vertest =
|
|
|
|
"\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" GREATER 2.4";
|
2016-07-10 11:05:52 +02:00
|
|
|
- fout << "# Generated by CMake " << cmVersion::GetCMakeVersion() << "\n\n";
|
2016-02-20 15:49:22 +01:00
|
|
|
+ fout << "# Generated by CMake\n\n";
|
|
|
|
fout << "if(" << vertest << ")\n";
|
|
|
|
fout << " # Information for CMake 2.6 and above.\n";
|
2016-07-10 11:05:52 +02:00
|
|
|
for (std::map<std::string, std::string>::const_iterator i =
|
2016-07-12 08:38:28 +02:00
|
|
|
--
|
|
|
|
1.7.10.4
|