diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py index 7d73a7cea014..43f262605922 100644 --- a/mesonbuild/cmake/toolchain.py +++ b/mesonbuild/cmake/toolchain.py @@ -212,7 +212,7 @@ def update_cmake_compiler_state(self) -> None: languages = list(self.compilers.keys()) lang_ids = [language_map.get(x, x.upper()) for x in languages] cmake_content = dedent(f''' - cmake_minimum_required(VERSION 3.7) + cmake_minimum_required(VERSION 3.10) project(CompInfo {' '.join(lang_ids)}) ''') diff --git a/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt index 2197667a3412..5a2589a973ce 100644 --- a/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) @@ -12,7 +12,7 @@ target_compile_definitions(cmModLib++ PRIVATE MESON_MAGIC_FLAG=21) target_compile_definitions(cmModLib++ INTERFACE MESON_MAGIC_FLAG=42) # Test PCH support -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16.0") target_precompile_headers(cmModLib++ PRIVATE "cpp_pch.hpp") endif() diff --git a/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt index e01b6e260517..ba6f70111328 100644 --- a/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/10 header only/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt index 88ba9bc57ad0..b77d7a3afae2 100644 --- a/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) diff --git a/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt index 27b37218a356..c7cd2ffc06b1 100644 --- a/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/12 generator expressions/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt index a6b0ba40c7d0..2557a2ae9a9e 100644 --- a/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/13 system includes/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt index 4d61b0c37ad7..04e7bdda14d4 100644 --- a/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/16 threads/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod C CXX) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/17 include path order/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/17 include path order/subprojects/cmMod/CMakeLists.txt index 9a252df18918..800ada9fd466 100644 --- a/test cases/cmake/17 include path order/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/17 include path order/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/18 skip include files/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/18 skip include files/subprojects/cmMod/CMakeLists.txt index 4db01b32da6a..50f87524638c 100644 --- a/test cases/cmake/18 skip include files/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/18 skip include files/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt index 7af9e6b97119..7dd11e74942f 100644 --- a/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/2 advanced/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set(CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/21 shared module/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/21 shared module/subprojects/cmMod/CMakeLists.txt index d2fcfe3ffde3..4770bc7b3d91 100644 --- a/test cases/cmake/21 shared module/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/21 shared module/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmModule) diff --git a/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt index a00affaebe26..9fc121b8b888 100644 --- a/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/23 cmake toolchain/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod NONE) diff --git a/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt b/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt index ecf1737fc223..cf84e13efe88 100644 --- a/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt +++ b/test cases/cmake/23 cmake toolchain/subprojects/cmModFortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) project(cmMod NONE) diff --git a/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt b/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt index a1886115bf5f..a25882bb340c 100644 --- a/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt +++ b/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmTest LANGUAGES C OBJC) diff --git a/test cases/cmake/25 assembler/subprojects/cmTest/CMakeLists.txt b/test cases/cmake/25 assembler/subprojects/cmTest/CMakeLists.txt index bb8834dc22bc..f8f014747a10 100644 --- a/test cases/cmake/25 assembler/subprojects/cmTest/CMakeLists.txt +++ b/test cases/cmake/25 assembler/subprojects/cmTest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmTest) diff --git a/test cases/cmake/27 dependency fallback/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/27 dependency fallback/subprojects/cmMod/CMakeLists.txt index f920576e27ea..2f4e31c9fbb2 100644 --- a/test cases/cmake/27 dependency fallback/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/27 dependency fallback/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod VERSION 1.2.3) set(CMAKE_CXX_STANDARD 14) @@ -12,7 +12,7 @@ target_compile_definitions(cmModLib++ PRIVATE MESON_MAGIC_FLAG=21) target_compile_definitions(cmModLib++ INTERFACE MESON_MAGIC_FLAG=42) # Test PCH support -if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16.0") target_precompile_headers(cmModLib++ PRIVATE "cpp_pch.hpp") endif() diff --git a/test cases/cmake/27 dependency fallback/subprojects/cmake_subp/CMakeLists.txt b/test cases/cmake/27 dependency fallback/subprojects/cmake_subp/CMakeLists.txt index 6443fcadd69a..51451a222bd9 100644 --- a/test cases/cmake/27 dependency fallback/subprojects/cmake_subp/CMakeLists.txt +++ b/test cases/cmake/27 dependency fallback/subprojects/cmake_subp/CMakeLists.txt @@ -1,2 +1,2 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmModDummy) diff --git a/test cases/cmake/27 dependency fallback/subprojects/force_cmake/CMakeLists.txt b/test cases/cmake/27 dependency fallback/subprojects/force_cmake/CMakeLists.txt index 497beb95ee18..442fc4eb6c40 100644 --- a/test cases/cmake/27 dependency fallback/subprojects/force_cmake/CMakeLists.txt +++ b/test cases/cmake/27 dependency fallback/subprojects/force_cmake/CMakeLists.txt @@ -1,2 +1,2 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmModBoth) diff --git a/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt index d738d45c9767..d31a6a294de7 100644 --- a/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set(CMAKE_CXX_STANDARD 14) diff --git a/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt index a5da5e7d21ef..65c725b25ff8 100644 --- a/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt +++ b/test cases/cmake/8 custom command/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/failing build/3 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt b/test cases/failing build/3 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt index 852dd09a8dab..a4564d3f1b25 100644 --- a/test cases/failing build/3 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt +++ b/test cases/failing build/3 cmake subproject isolation/subprojects/cmMod/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmMod) set (CMAKE_CXX_STANDARD 14) diff --git a/test cases/failing/109 cmake executable dependency/subprojects/cmlib/CMakeLists.txt b/test cases/failing/109 cmake executable dependency/subprojects/cmlib/CMakeLists.txt index 006787986f0f..e927eae8f944 100644 --- a/test cases/failing/109 cmake executable dependency/subprojects/cmlib/CMakeLists.txt +++ b/test cases/failing/109 cmake executable dependency/subprojects/cmlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmlib) diff --git a/test cases/failing/119 cmake subproject error/subprojects/cmlib/CMakeLists.txt b/test cases/failing/119 cmake subproject error/subprojects/cmlib/CMakeLists.txt index edbe39535c1f..a845525b8df0 100644 --- a/test cases/failing/119 cmake subproject error/subprojects/cmlib/CMakeLists.txt +++ b/test cases/failing/119 cmake subproject error/subprojects/cmlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(cmlib) diff --git a/test cases/unit/1 soname/CMakeLists.txt b/test cases/unit/1 soname/CMakeLists.txt index c4f2e3eb93d8..47571b1c1e7b 100644 --- a/test cases/unit/1 soname/CMakeLists.txt +++ b/test cases/unit/1 soname/CMakeLists.txt @@ -7,7 +7,7 @@ # soname to 1.2.3 but Autotools sets it to 1. project(vertest C) -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION ${CMAKE_VERSION}) add_library(nover SHARED versioned.c)