From 3feee8fab2756cf7e6338ba685a097e93850edb0 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 20 Jan 2025 15:15:16 +0100 Subject: [PATCH] Drop support for CMake <3.10 Symptom was: > CMake Deprecation Warning at CMakeLists.txt:37 (cmake_minimum_required): > Compatibility with CMake < 3.10 will be removed from a future version of > CMake. > Update the VERSION argument value. Or, use the ... syntax > to tell CMake that the project requires at least but has been updated > to work with policies introduced by or earlier. --- expat/CMakeLists.txt | 10 ++-------- expat/README.md | 9 ++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index eef4ed8f..de4354b3 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -34,7 +34,7 @@ # Unlike most of Expat, # this file is copyrighted under the BSD-license for buildsystem files of KDE. -cmake_minimum_required(VERSION 3.5.0) +cmake_minimum_required(VERSION 3.10.0) project(expat VERSION @@ -911,13 +911,7 @@ elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t") else() set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR") endif() -# NOTE: We're not accessing global property GENERATOR_IS_MULTI_CONFIG -# because that would require CMake >=3.9 -if(CMAKE_CONFIGURATION_TYPES) - set(_EXPAT_GENERATOR_IS_MULTI_CONFIG TRUE) -else() - set(_EXPAT_GENERATOR_IS_MULTI_CONFIG FALSE) -endif() +get_property(_EXPAT_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) message(STATUS "===========================================================================") message(STATUS "") diff --git a/expat/README.md b/expat/README.md index 633011ed..c7aa15a1 100644 --- a/expat/README.md +++ b/expat/README.md @@ -52,7 +52,7 @@ This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake Notice the *uppercase* `EXPAT` in the following example: ```cmake -cmake_minimum_required(VERSION 3.0) # or 3.10, see below +cmake_minimum_required(VERSION 3.10) project(hello VERSION 1.0.0) @@ -62,12 +62,7 @@ add_executable(hello hello.c ) -# a) for CMake >=3.10 (see CMake's FindEXPAT docs) target_link_libraries(hello PUBLIC EXPAT::EXPAT) - -# b) for CMake >=3.0 -target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) -target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) ``` ### b) `find_package` with Config Mode @@ -85,7 +80,7 @@ or Notice the *lowercase* `expat` in the following example: ```cmake -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) project(hello VERSION 1.0.0)