From 75be07fa342d833bed07fe51effada18afd0c7df Mon Sep 17 00:00:00 2001 From: binary1248 Date: Tue, 3 Oct 2023 05:51:38 +0200 Subject: [PATCH] Fix CMake minimum required version being too low to support specifying SYSTEM in target_include_directories for Visual Studio generators. --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a56f25b15..70e4dd57c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,12 @@ -cmake_minimum_required(VERSION 3.22) +if(CMAKE_HOST_WIN32) + # We require a CMake version greater than or equal to 3.24 on Windows in order to + # support specifying target_include_directories with SYSTEM for Visual Studio Generators + # see: https://cmake.org/cmake/help/latest/release/3.24.html#generators + cmake_minimum_required(VERSION 3.24) +else() + # For all other systems, 3.22 will suffice + cmake_minimum_required(VERSION 3.22) +endif() # define a macro that helps defining an option macro(sfml_set_option var default type docstring)