From 8709b4fa00021845bfc87f928aa3443491128081 Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Mon, 6 Jul 2020 10:10:49 +0800 Subject: [PATCH] fix cannot find python-dev signed-off-by: zhoufeng --- cmake/check_requirements.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/check_requirements.cmake b/cmake/check_requirements.cmake index 2aadd6fb3ba..24b9baad1ad 100644 --- a/cmake/check_requirements.cmake +++ b/cmake/check_requirements.cmake @@ -19,9 +19,14 @@ set(Python3_USE_STATIC_LIBS FALSE) find_package(Python3 COMPONENTS Interpreter Development) if (Python3_FOUND) message("Python3 found, version: ${Python3_VERSION}") - message("Python3 library path: ${Python3_LIBRARY_DIRS}") + message("Python3 library path: ${Python3_LIBRARY}") message("Python3 interpreter: ${Python3_EXECUTABLE}") - else() +elseif (Python3_LIBRARY AND Python3_EXECUTABLE AND + ${Python3_VERSION} VERSION_GREATER_EQUAL "3.7.0" AND ${Python3_VERSION} VERSION_LESS "3.8.0") + message(WARNING "Maybe python3 environment is broken.") + message("Python3 library path: ${Python3_LIBRARY}") + message("Python3 interpreter: ${Python3_EXECUTABLE}") +else () message(FATAL_ERROR "Python3 not found, please install Python>=3.7.5, and set --enable-shared " "if you are building Python locally") endif ()