Skip to content

Commit dc0d4e3

Browse files
author
Cody Piersall
committed
Use the CMake-provided PythonLibs on newer CMake versions.
1 parent a54eab9 commit dc0d4e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/pybind11Tools.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ if(NOT PYBIND11_PYTHON_VERSION)
1313
endif()
1414

1515
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4)
16-
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
16+
# this minimum was determined by testing, and could potentially be made lower
17+
if(CMAKE_VERSION VERSION_LESS 3.10.2)
18+
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
19+
else()
20+
find_package(PythonLibs ${PYBIND11_PYTHON_VERSION} REQUIRED)
21+
endif()
1722

1823
include(CheckCXXCompilerFlag)
1924
include(CMakeParseArguments)

0 commit comments

Comments
 (0)