From 5c7cf6582111028eb5fa6b470a98f0585f1ba928 Mon Sep 17 00:00:00 2001 From: KeVteL Date: Fri, 24 Jan 2025 08:34:11 +0100 Subject: [PATCH] Fixed install path for the python-wrapper .so file Signed-off-by: Kevin Vu te Laar --- clients/python-wrapper/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clients/python-wrapper/CMakeLists.txt b/clients/python-wrapper/CMakeLists.txt index 706ca3ee0..a5c7f91c2 100644 --- a/clients/python-wrapper/CMakeLists.txt +++ b/clients/python-wrapper/CMakeLists.txt @@ -5,10 +5,16 @@ set(PYBIND11_FINDPYTHON ON) find_package(pybind11 CONFIG REQUIRED) find_package(Python3 COMPONENTS Interpreter Development REQUIRED) +execute_process( + COMMAND "${Python3_EXECUTABLE}" -c "import sysconfig; print(sysconfig.get_path('stdlib') + '/lib-dynload')" + OUTPUT_VARIABLE PYTHON_LIB_DYNLOAD_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE +) + message(STATUS "Found Python version: ${Python_VERSION}") message(STATUS "Python major version: ${Python_VERSION_MAJOR}") message(STATUS "Python minor version: ${Python_VERSION_MINOR}") -message(STATUS "Python .so install directory: /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/lib-dynload") +message(STATUS "Python .so install directory: ${PYTHON_LIB_DYNLOAD_DIR}") pybind11_add_module(villas_node villas-python-wrapper.cpp) target_link_libraries(villas_node PUBLIC villas) @@ -17,5 +23,5 @@ install( TARGETS villas_node COMPONENT lib RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/lib-dynload + LIBRARY DESTINATION ${PYTHON_LIB_DYNLOAD_DIR} )