Skip to content

Commit 55153bb

Browse files
committed
fix(cmake): allow forcing old FindPython
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 8b48ff8 commit 55153bb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tools/pybind11Common.cmake

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,14 @@ endif()
174174
if(PYBIND11_NOPYTHON)
175175
set(_pybind11_nopython ON)
176176
elseif(
177-
_pybind11_missing_old_python STREQUAL "NEW"
178-
OR PYBIND11_FINDPYTHON
179-
OR Python_FOUND
180-
OR Python2_FOUND
181-
OR Python3_FOUND)
177+
NOT (DEFINED PYBIND11_FINDPYTHON AND NOT PYBIND11_FINDPYTHON)
178+
AND (_pybind11_missing_old_python STREQUAL "NEW"
179+
OR PYBIND11_FINDPYTHON
180+
OR Python_FOUND
181+
OR Python2_FOUND
182+
OR Python3_FOUND
183+
))
184+
182185
# New mode
183186
include("${CMAKE_CURRENT_LIST_DIR}/pybind11NewTools.cmake")
184187

0 commit comments

Comments
 (0)