Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmake): allow forcing old FindPython #5042

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions tools/pybind11Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,16 @@ endif()
# Check to see which Python mode we are in, new, old, or no python
if(PYBIND11_NOPYTHON)
set(_pybind11_nopython ON)
# We won't use new FindPython if PYBIND11_FINDPYTHON is defined and falselike
# Otherwise, we use if FindPythonLibs is missing or if FindPython was already used
elseif(
_pybind11_missing_old_python STREQUAL "NEW"
OR PYBIND11_FINDPYTHON
OR Python_FOUND
OR Python2_FOUND
OR Python3_FOUND)
(NOT DEFINED PYBIND11_FINDPYTHON OR PYBIND11_FINDPYTHON)
AND (_pybind11_missing_old_python STREQUAL "NEW"
OR PYBIND11_FINDPYTHON
OR Python_FOUND
OR Python3_FOUND
))

# New mode
include("${CMAKE_CURRENT_LIST_DIR}/pybind11NewTools.cmake")

Expand Down
Loading