From f0bf16da643c185685b0350943855fd312cddbb7 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 22 Sep 2025 18:18:19 +0200 Subject: [PATCH] [CMake] Set the minimum required version to 3.23 This version of CMake was released in March 2022 https://github.com/Kitware/CMake/releases/tag/v3.23.0 This version is required to use FILE_SETs, which could help towards https://github.com/root-project/root/issues/16327 and https://github.com/root-project/root/pull/18419. Since cmake_minimum_required updates the cmake_policy from 3.20 to 3.23, we need to take care of a change that happened from 3.20 to 3.21 that leads to an error in the CheckCompiler CMake module, so set the proper policy flag to old to avoid that error on some platforms. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6af6274dd623..c8d3e0769c8f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # For the licensing terms see $ROOTSYS/LICENSE. # For the list of contributors see $ROOTSYS/README/CREDITS. -cmake_minimum_required(VERSION 3.20 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23 FATAL_ERROR) if(WIN32) # Set CMP0091 (MSVC runtime library flags are selected by an abstraction) to OLD @@ -61,7 +61,7 @@ foreach(policy ${policy_new}) endif() endforeach() -set(policy_old CMP0116 CMP0135 CMP0144) +set(policy_old CMP0116 CMP0126 CMP0135 CMP0144) foreach(policy ${policy_old}) if(POLICY ${policy}) cmake_policy(SET ${policy} OLD)