Skip to content

Commit 71f25cd

Browse files
fix: findPython
1 parent a7288ce commit 71f25cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ endif()
4949
# Running find_package(PythonInterp) to retrieve the Python version
5050
# which is not exported by Pybind11's cmake.
5151
# Cf. https://github.com/pybind/pybind11/issues/2268
52-
find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED)
52+
#find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED)
53+
# the above line uses a deprecated cmake method, use the following instead
54+
find_package(Python COMPONENTS Interpreter REQUIRED)
5355

5456
set(pybind11_REQUIRED_VERSION 2.6.1)
5557
if(TARGET pybind11 OR TARGET pybind11::headers)

0 commit comments

Comments
 (0)