Browse Source

CMake: fix version deprecation warning on CMake 3.31.

pull/659/head
Vladimír Vondruš 1 year ago
parent
commit
002a40d0be
  1. 9
      CMakeLists.txt

9
CMakeLists.txt

@ -26,7 +26,7 @@
# #
# Matches Corrade requirement, see its root CMakeLists for more information. # Matches Corrade requirement, see its root CMakeLists for more information.
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5...3.10)
option(HUNTER_ENABLED "Get dependencies (Corrade, GLFW, SDL2, ...) via Hunter" OFF) option(HUNTER_ENABLED "Get dependencies (Corrade, GLFW, SDL2, ...) via Hunter" OFF)
# This option is meant to be passed on the very first invocation. If not done # This option is meant to be passed on the very first invocation. If not done
@ -38,6 +38,13 @@ if(HUNTER_ENABLED)
include(${CMAKE_CURRENT_LIST_DIR}/package/hunter/HunterInit.cmake) include(${CMAKE_CURRENT_LIST_DIR}/package/hunter/HunterInit.cmake)
endif() endif()
# 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 # Don't restrict INTERPROCEDURAL_OPTIMIZATION only for icc on Linux
if(POLICY CMP0069) if(POLICY CMP0069)
cmake_policy(SET CMP0069 NEW) cmake_policy(SET CMP0069 NEW)

Loading…
Cancel
Save