From 8853cb0b6ed38b424100b18814cd99deb9afcd03 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 27 Nov 2021 07:23:11 +0000 Subject: [PATCH] Set `CMAKE_POLICY_DEFAULT_CMPNNNN` See https://gitlab.kitware.com/cmake/cmake/-/issues/20312#note_692953 --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbfa2198a..def5337b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,14 @@ if(POLICY CMP0111) cmake_policy(SET CMP0111 NEW) endif() +# Projects added via `add_subdirectory` or `FetchContent` may have a lower +# `cmake_minimum_required` than we set here. Set policies that we require +# to their new value so that they still apply. +set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/dist") - message("-- Detect a source distribution with the required FetchContent dependencies and devilutionx.mpq included") + message("-- Detected a source distribution with the required FetchContent dependencies and devilutionx.mpq included") set(SRC_DIST ON) add_subdirectory(dist) endif()