From 8498c32a785882fae25072ec65c4be6de9a1b7ab Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 26 May 2020 18:41:24 +0200 Subject: [PATCH] cmake support python < 3.8 and 3.8 --- client/CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 285a20144..644008497 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -38,6 +38,7 @@ endforeach() find_package(PkgConfig) pkg_search_module(BLUEZ QUIET bluez) pkg_search_module(PYTHON3 QUIET python3) +pkg_search_module(PYTHON3EMBED QUIET python3-embed) SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -225,12 +226,17 @@ if (BLUEZ_FOUND) set(ADDITIONAL_LNK bluetooth ${ADDITIONAL_LNK}) endif (BLUEZ_FOUND) -if (PYTHON3_FOUND) +if (PYTHON3EMBED_FOUND) message("Python3 library found, building with python3 support :)") add_definitions("-DHAVE_PYTHON") - set(ADDITIONAL_DIRS ${ADDITIONAL_DIRS} ${PYTHON3_INCLUDE_DIRS}) - set(ADDITIONAL_LNK ${ADDITIONAL_LNK} ${PYTHON3_LIBRARIES}) -endif (PYTHON3_FOUND) + set(ADDITIONAL_DIRS ${PYTHON3EMBED_INCLUDE_DIRS} ${ADDITIONAL_DIRS}) + set(ADDITIONAL_LNK ${PYTHON3EMBED_LIBRARIES} ${ADDITIONAL_LNK}) +elseif (PYTHON3_FOUND) + message("Python3 library found, building with python3 support :)") + add_definitions("-DHAVE_PYTHON") + set(ADDITIONAL_DIRS ${PYTHON3_INCLUDE_DIRS} ${ADDITIONAL_DIRS}) + set(ADDITIONAL_LNK ${PYTHON3_LIBRARIES} ${ADDITIONAL_LNK}) +endif (PYTHON3EMBED_FOUND) add_executable( proxmark3