From bb504dd809468b124592efe955816b080977d666 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 20 Mar 2025 17:38:30 -0400 Subject: [PATCH] fix: FindPython by default logic error (#5561) Signed-off-by: Henry Schreiner --- tools/pybind11Common.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/pybind11Common.cmake b/tools/pybind11Common.cmake index 138a67501..0af50d520 100644 --- a/tools/pybind11Common.cmake +++ b/tools/pybind11Common.cmake @@ -184,8 +184,11 @@ if(PYBIND11_NOPYTHON) # 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( - (NOT DEFINED PYBIND11_FINDPYTHON OR PYBIND11_FINDPYTHON) + (NOT DEFINED PYBIND11_FINDPYTHON + OR PYBIND11_FINDPYTHON STREQUAL "COMPAT" + OR PYBIND11_FINDPYTHON) AND (_pybind11_missing_old_python STREQUAL "NEW" + OR PYBIND11_FINDPYTHON STREQUAL "COMPAT" OR PYBIND11_FINDPYTHON OR Python_FOUND OR Python3_FOUND