From d27fdaa27287b46af3d29140251a730317d92a02 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 31 Mar 2025 22:50:40 -0400 Subject: [PATCH] chore: update for CMake 4.0 (#5593) Signed-off-by: Henry Schreiner --- CMakeLists.txt | 2 +- docs/advanced/embedding.rst | 2 +- docs/compiling.rst | 10 +++++----- tests/CMakeLists.txt | 2 +- tests/test_cmake_build/installed_embed/CMakeLists.txt | 2 +- .../test_cmake_build/installed_function/CMakeLists.txt | 2 +- tests/test_cmake_build/installed_target/CMakeLists.txt | 2 +- .../test_cmake_build/subdirectory_embed/CMakeLists.txt | 2 +- .../subdirectory_function/CMakeLists.txt | 2 +- .../subdirectory_target/CMakeLists.txt | 2 +- tools/pybind11GuessPythonExtSuffix.cmake | 2 +- tools/test-pybind11GuessPythonExtSuffix.cmake | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 486fd3ef6..36484e04d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT CMAKE_VERSION VERSION_LESS "3.27") cmake_policy(GET CMP0148 _pybind11_cmp0148) endif() -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) if(_pybind11_cmp0148) cmake_policy(SET CMP0148 ${_pybind11_cmp0148}) diff --git a/docs/advanced/embedding.rst b/docs/advanced/embedding.rst index e78a8f4ce..dc09161ec 100644 --- a/docs/advanced/embedding.rst +++ b/docs/advanced/embedding.rst @@ -18,7 +18,7 @@ information, see :doc:`/compiling`. .. code-block:: cmake - cmake_minimum_required(VERSION 3.15...3.30) + cmake_minimum_required(VERSION 3.15...4.0) project(example) find_package(pybind11 REQUIRED) # or `add_subdirectory(pybind11)` diff --git a/docs/compiling.rst b/docs/compiling.rst index 94042c3e5..cedeefa06 100644 --- a/docs/compiling.rst +++ b/docs/compiling.rst @@ -18,7 +18,7 @@ A Python extension module can be created with just a few lines of code: .. code-block:: cmake - cmake_minimum_required(VERSION 3.15...3.30) + cmake_minimum_required(VERSION 3.15...4.0) project(example LANGUAGES CXX) set(PYBIND11_FINDPYTHON ON) @@ -447,7 +447,7 @@ See the `Config file`_ docstring for details of relevant CMake variables. .. code-block:: cmake - cmake_minimum_required(VERSION 3.15...3.30) + cmake_minimum_required(VERSION 3.15...4.0) project(example LANGUAGES CXX) find_package(pybind11 REQUIRED) @@ -492,7 +492,7 @@ FindPython, pybind11 will detect this and use the existing targets instead: .. code-block:: cmake - cmake_minimum_required(VERSION 3.15...3.30) + cmake_minimum_required(VERSION 3.15...4.0) project(example LANGUAGES CXX) find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED) @@ -570,7 +570,7 @@ You can use these targets to build complex applications. For example, the .. code-block:: cmake - cmake_minimum_required(VERSION 3.15...3.30) + cmake_minimum_required(VERSION 3.15...4.0) project(example LANGUAGES CXX) find_package(pybind11 REQUIRED) # or add_subdirectory(pybind11) @@ -628,7 +628,7 @@ information about usage in C++, see :doc:`/advanced/embedding`. .. code-block:: cmake - cmake_minimum_required(VERSION 3.15...3.30) + cmake_minimum_required(VERSION 3.15...4.0) project(example LANGUAGES CXX) find_package(pybind11 REQUIRED) # or add_subdirectory(pybind11) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1b65729df..830c0374a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,7 +5,7 @@ # All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) # Filter out items; print an optional message if any items filtered. This ignores extensions. # diff --git a/tests/test_cmake_build/installed_embed/CMakeLists.txt b/tests/test_cmake_build/installed_embed/CMakeLists.txt index 5c6267c72..8561ef438 100644 --- a/tests/test_cmake_build/installed_embed/CMakeLists.txt +++ b/tests/test_cmake_build/installed_embed/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) project(test_installed_embed CXX) diff --git a/tests/test_cmake_build/installed_function/CMakeLists.txt b/tests/test_cmake_build/installed_function/CMakeLists.txt index 2945b3d2e..8e75f86e6 100644 --- a/tests/test_cmake_build/installed_function/CMakeLists.txt +++ b/tests/test_cmake_build/installed_function/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) project(test_installed_function CXX) diff --git a/tests/test_cmake_build/installed_target/CMakeLists.txt b/tests/test_cmake_build/installed_target/CMakeLists.txt index 344c8bc69..d8af4391b 100644 --- a/tests/test_cmake_build/installed_target/CMakeLists.txt +++ b/tests/test_cmake_build/installed_target/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) project(test_installed_target CXX) diff --git a/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt b/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt index d0ae0798e..d84916ea7 100644 --- a/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +++ b/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) project(test_subdirectory_embed CXX) diff --git a/tests/test_cmake_build/subdirectory_function/CMakeLists.txt b/tests/test_cmake_build/subdirectory_function/CMakeLists.txt index a521f33df..f35549288 100644 --- a/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +++ b/tests/test_cmake_build/subdirectory_function/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) project(test_subdirectory_function CXX) diff --git a/tests/test_cmake_build/subdirectory_target/CMakeLists.txt b/tests/test_cmake_build/subdirectory_target/CMakeLists.txt index 4a5a7f2be..aadc8c0d8 100644 --- a/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +++ b/tests/test_cmake_build/subdirectory_target/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) project(test_subdirectory_target CXX) diff --git a/tools/pybind11GuessPythonExtSuffix.cmake b/tools/pybind11GuessPythonExtSuffix.cmake index b550f3935..b8c351ef0 100644 --- a/tools/pybind11GuessPythonExtSuffix.cmake +++ b/tools/pybind11GuessPythonExtSuffix.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) function(pybind11_guess_python_module_extension python) diff --git a/tools/test-pybind11GuessPythonExtSuffix.cmake b/tools/test-pybind11GuessPythonExtSuffix.cmake index ac90e039b..a66282db2 100644 --- a/tools/test-pybind11GuessPythonExtSuffix.cmake +++ b/tools/test-pybind11GuessPythonExtSuffix.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15...3.30) +cmake_minimum_required(VERSION 3.15...4.0) # Tests for pybind11_guess_python_module_extension # Run using `cmake -P tools/test-pybind11GuessPythonExtSuffix.cmake`