SHA256
3
0
forked from pool/cmake
cmake/cmake-version-in-generated-files.patch
Martin Pluskal 6b48c28e79 Accepting request 407851 from home:mathletic:branches:devel:tools:building
replace openSuse-specific patch by reduced patch from upstream. If it was reduced to far, we have to modify it and try to upstream it again.

OBS-URL: https://build.opensuse.org/request/show/407851
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=256
2016-07-12 06:38:28 +00:00

43 lines
2.0 KiB
Diff

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
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()
// Protect that file against use with older CMake versions.
/* clang-format off */
- 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";
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
// versions.
const char* vertest =
"\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" GREATER 2.4";
- fout << "# Generated by CMake " << cmVersion::GetCMakeVersion() << "\n\n";
+ fout << "# Generated by CMake\n\n";
fout << "if(" << vertest << ")\n";
fout << " # Information for CMake 2.6 and above.\n";
for (std::map<std::string, std::string>::const_iterator i =
--
1.7.10.4