From a2cb1754a59d870f2a507d071d0c6c5891702645 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 20 Apr 2022 13:47:11 -0400 Subject: 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. --- Source/cmExportFileGenerator.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 6d6df71..3143c12 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 */ } -- cgit v0.12