summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-04-27 11:30:46 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-04-27 11:30:46 (GMT)
commit68d6394cef95edf789888e246fcd07531078f55b (patch)
treeefe81bb7510290ab9c72fab044456f56f1ef1236 /Source/cmExportFileGenerator.cxx
parent05f84cb09138684eedddc96485cd51574b4709bb (diff)
downloadCMake-68d6394cef95edf789888e246fcd07531078f55b.zip
CMake-68d6394cef95edf789888e246fcd07531078f55b.tar.gz
CMake-68d6394cef95edf789888e246fcd07531078f55b.tar.bz2
ENH: protect the export files against inclusion with cmake 2.4
Alex
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 1e0a8d9..e1bbe29 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -79,6 +79,12 @@ bool cmExportFileGenerator::GenerateImportFile()
}
std::ostream& os = *foutPtr;
+ // Protect that file against use with older CMake versions.
+ os << "# Generated by CMake " << cmVersion::GetCMakeVersion() << "\n\n";
+ os << "IF(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.5)\n"
+ << " MESSAGE(FATAL_ERROR \"CMake >= 2.6.0 required\")\n"
+ << "ENDIF(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.5)\n";
+
// Isolate the file policy level.
// We use 2.6 here instead of the current version because newer
// versions of CMake should be able to export files imported by 2.6