From d91785d6e2f46fdec56289be5362f58915533d0c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 12 Nov 2024 23:30:01 -0800 Subject: [PATCH] CMake: fix to support CMake 3.31. Expand the "still support old versions of CMake, for the benefit of people with older versions, but avoid deprecation warnings/errors" section to handle the deprecation of pre-3.10 versions by 3.31. (cherry picked from commit 199bb821ba57097b8629a0d992779483b424e7a4) --- CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e986d68..a5c2c883 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,14 +13,21 @@ else(WIN32) # on a "long-term support" version # of some OS and that # version supplies an older version of CMake; # - # otherwise, require 3.5, so we don't get messages warning - # that support for versions of CMake lower than 3.5 is + # otherwise, if it's a version less than 3.10, require only + # 3.10, just in case somebody is configuring with CMake + # on a "long-term support" version # of some OS and that + # version supplies an older version of CMake; + # + # otherwise, require 3.10, so we don't get messages warning + # that support for versions of CMake lower than 3.10 is # deprecated. # if(CMAKE_VERSION VERSION_LESS "3.5") cmake_minimum_required(VERSION 2.8.12) - else() + elseif(CMAKE_VERSION VERSION_LESS "3.10") cmake_minimum_required(VERSION 3.5) + else() + cmake_minimum_required(VERSION 3.10) endif() endif(WIN32) -- 2.39.5