| From 6bb112e585f2ffd10e5af70ca28159dd235d063b Mon Sep 17 00:00:00 2001 |
| From: wsnipex <wsnipex@a1.net> |
| Date: Thu, 19 Aug 2021 08:50:05 +0200 |
| Subject: [PATCH] [cmake] search for python interpreter fixes installing |
| eventclients on linux |
| |
| Backport of https://github.com/xbmc/xbmc/pull/20058 |
| |
| Patch sent upstream: https://github.com/xbmc/xbmc/pull/20989 |
| |
| Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> |
| --- |
| cmake/modules/FindPython.cmake | 5 +++++ |
| 1 file changed, 5 insertions(+) |
| |
| diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake |
| index 35220b5426..c469ed9fb6 100644 |
| --- a/cmake/modules/FindPython.cmake |
| +++ b/cmake/modules/FindPython.cmake |
| @@ -20,6 +20,7 @@ |
| # |
| # PYTHON_FOUND - system has PYTHON |
| # PYTHON_VERSION - Python version number (Major.Minor) |
| +# PYTHON_EXECUTABLE - Python interpreter binary |
| # PYTHON_INCLUDE_DIRS - the python include directory |
| # PYTHON_LIBRARIES - The python libraries |
| # PYTHON_LDFLAGS - Python provided link options |
| @@ -51,6 +52,9 @@ if(PYTHON_VER) |
| endif() |
| |
| find_package(Python3 ${VERSION} ${EXACT_VER} COMPONENTS Development) |
| +if(CORE_SYSTEM_NAME STREQUAL linux) |
| + find_package(Python3 ${VERSION} ${EXACT_VER} COMPONENTS Interpreter) |
| +endif() |
| |
| if(KODI_DEPENDSBUILD) |
| find_library(FFI_LIBRARY ffi REQUIRED) |
| @@ -73,6 +77,7 @@ if(Python3_FOUND) |
| list(APPEND PYTHON_DEFINITIONS -DHAS_PYTHON=1) |
| # These are all set for easy integration with the rest of our build system |
| set(PYTHON_FOUND ${Python3_FOUND}) |
| + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Python interpreter" FORCE) |
| set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) |
| set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) |
| set(PYTHON_VERSION "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" CACHE INTERNAL "" FORCE) |
| -- |
| 2.30.2 |
| |