fix: support CMake 3.27, drop 3.4 (#4719)

* fix: support CMake 3.27, drop 3.4

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update upgrade.rst

* Update upgrade.rst

* Update upgrade.rst

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2023-07-12 13:10:24 -05:00
committed by GitHub
parent 6d22dba82f
commit 2e5f5c4cf8
16 changed files with 75 additions and 49 deletions

View File

@@ -163,11 +163,19 @@ endif()
# --------------------- Python specifics -------------------------
# CMake 3.27 removes the classic FindPythonInterp if CMP0148 is NEW
if(CMAKE_VERSION VERSION_LESS "3.27")
set(_pybind11_missing_old_python "OLD")
else()
cmake_policy(GET CMP0148 _pybind11_missing_old_python)
endif()
# Check to see which Python mode we are in, new, old, or no python
if(PYBIND11_NOPYTHON)
set(_pybind11_nopython ON)
elseif(
PYBIND11_FINDPYTHON
_pybind11_missing_old_python STREQUAL "NEW"
OR PYBIND11_FINDPYTHON
OR Python_FOUND
OR Python2_FOUND
OR Python3_FOUND)