From 570947a7a0182d1801519238697f7f24c0eb7d33 Mon Sep 17 00:00:00 2001 From: Zheng-Bicheng <58363586+Zheng-Bicheng@users.noreply.github.com> Date: Mon, 27 May 2024 20:41:37 +0800 Subject: [PATCH] Update find_package PythonInterp PythonLibs (#1263) --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 537b1e0aa..2a1d9d5c0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,7 +150,11 @@ if (BUILD_PADDLE2ONNX_PYTHON) endif () endif () - find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) + # find_package Python has replaced PythonInterp and PythonLibs since cmake 3.12 + # Use the following command in the future; now this is only compatible with the latest pybind11 +# find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED) + find_package(PythonInterp ${PY_VERSION} REQUIRED) + find_package(PythonLibs ${PY_VERSION}) if (CMAKE_SYSTEM_NAME STREQUAL "AIX") set(CMAKE_NO_SYSTEM_FROM_IMPORTED 1) endif ()