From 2cbfcd232758967fa84794967d71d9584ec799ec Mon Sep 17 00:00:00 2001 From: glx22 Date: Fri, 5 Feb 2021 02:00:36 +0100 Subject: [PATCH] Change: [CMake] Bump minimum version to 3.9 --- CMakeLists.txt | 11 +++-------- cmake/FindICU.cmake | 5 +++++ src/settingsgen/CMakeLists.txt | 2 +- src/strgen/CMakeLists.txt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be544316dd..8fbf3507d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) if(NOT BINARY_NAME) set(BINARY_NAME openttd) @@ -143,13 +143,8 @@ find_package(Xaudio2) find_package(Grfcodec) -# IPO is only properly supported from CMake 3.9. Despite the fact we are -# CMake 3.5, still enable IPO if we detect we are 3.9+. -if(POLICY CMP0069) - cmake_policy(SET CMP0069 NEW) - include(CheckIPOSupported) - check_ipo_supported(RESULT IPO_FOUND) -endif() +include(CheckIPOSupported) +check_ipo_supported(RESULT IPO_FOUND) show_options() diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake index b110dbf404..d12f36b0ad 100644 --- a/cmake/FindICU.cmake +++ b/cmake/FindICU.cmake @@ -1,3 +1,8 @@ +# CMake provides a FindICU module since version 3.7. +# But it doesn't use pkgconfig, doesn't set expected variables, +# And it returns incomplete dependencies if only some modules are searched. + + #[=======================================================================[.rst: FindICU ------- diff --git a/src/settingsgen/CMakeLists.txt b/src/settingsgen/CMakeLists.txt index 69b2092017..43d5284e62 100644 --- a/src/settingsgen/CMakeLists.txt +++ b/src/settingsgen/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) if (NOT HOST_BINARY_DIR) project(settingsgen) diff --git a/src/strgen/CMakeLists.txt b/src/strgen/CMakeLists.txt index 08c1223350..490f675f2e 100644 --- a/src/strgen/CMakeLists.txt +++ b/src/strgen/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.9) if (NOT HOST_BINARY_DIR) project(strgen)