From 1d88f38b5d783ed53c04dd44cb684f16b50f1355 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 14 May 2021 10:42:26 +0200 Subject: [PATCH] python development is not always required (#43212) * python dev not always required * simpler approach --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c49a2afb224..42152dfe3d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -941,7 +941,13 @@ set(QGIS_INSTALL_SYS_LIBS TRUE CACHE BOOL "If set to TRUE install all required s set(MIN_PYTHON_VERSION "3.7") set(Python_FIND_FRAMEWORK "LAST") -find_package(Python ${MIN_PYTHON_VERSION} REQUIRED COMPONENTS Interpreter Development) + +if (WITH_BINDINGS) + find_package(Python ${MIN_PYTHON_VERSION} REQUIRED COMPONENTS Interpreter Development) +else() + find_package(Python ${MIN_PYTHON_VERSION} REQUIRED COMPONENTS Interpreter) +endif() + message("-- Found Python executable: ${Python_EXECUTABLE} (version ${Python_VERSION})") message("-- Python library: ${Python_LIBRARIES}") message("-- Python site-packages: ${Python_SITEARCH}")