From 585b4b7cf728e214c7cea44e34536859a96fef0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 13 Nov 2024 16:08:14 +0100 Subject: [PATCH] CMake: fix version deprecation warning on CMake 3.31. --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10bcf97..0ffcf81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,14 @@ # # Matches Corrade requirement, see its root CMakeLists for more information. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5...3.10) + +# CMake 3.12+ uses the policy max version specified in +# cmake_minimum_required(), meaning that with ...3.10, everything until CMP0071 +# gets set to NEW implicitly. We however want to keep compatibility with +# versions before 3.12, so the NEW policies are still being hand-picked. Also +# don't want to do a blanket cmake_policy(VERSION) because that may break +# behavior for existing projects that rely on the OLD behavior. # Don't restrict INTERPROCEDURAL_OPTIMIZATION only for icc on Linux if(POLICY CMP0069)