summaryrefslogtreecommitdiff
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-04-20 13:47:11 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2022-04-20 14:09:46 -0400
commita2cb1754a59d870f2a507d071d0c6c5891702645 (patch)
tree3fe19137f6149023c7226d67db746eeb604117b5 /Source/cmExportFileGenerator.cxx
parent722e4d4619d32fa3da1a3de7fb7b37a87f5a6a8c (diff)
downloadcmake-a2cb1754a59d870f2a507d071d0c6c5891702645.tar.gz
cmExportFileGenerator: require CMake 2.8.3
This allows use of `CMAKE_CURRENT_LIST_DIR`, `foreach(IN LISTS)`, `if(VERSION_*)`, and more. Note that generated filesets code already uses `if(VERSION_*)` and requires CMake 2.8.3 in practice.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 6d6df71ab2..3143c12223 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -922,8 +922,11 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os)
// Protect that file against use with older CMake versions.
/* clang-format off */
os << "# Generated by CMake\n\n";
- os << "if(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.6)\n"
- << " message(FATAL_ERROR \"CMake >= 2.6.0 required\")\n"
+ os << "if(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.8)\n"
+ << " message(FATAL_ERROR \"CMake >= 2.8.0 required\")\n"
+ << "endif()\n"
+ << "if(CMAKE_VERSION VERSION_LESS \"2.8.3\")\n"
+ << " message(FATAL_ERROR \"CMake >= 2.8.3 required\")\n"
<< "endif()\n";
/* clang-format on */
@@ -935,7 +938,7 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os)
// versions.
/* clang-format off */
os << "cmake_policy(PUSH)\n"
- << "cmake_policy(VERSION 2.6...3.22)\n";
+ << "cmake_policy(VERSION 2.8.3...3.22)\n";
/* clang-format on */
}