From 20a09a0d03a36c32bb39e7bc6d556a151f2946bb Mon Sep 17 00:00:00 2001 From: Jona Saffer Date: Sun, 2 Feb 2025 02:41:47 +0100 Subject: [PATCH] Use proper python module destination --- src/pythonlib/pythonlib.cmake | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/pythonlib/pythonlib.cmake b/src/pythonlib/pythonlib.cmake index 8b6cea88..5b5c8c74 100644 --- a/src/pythonlib/pythonlib.cmake +++ b/src/pythonlib/pythonlib.cmake @@ -3,6 +3,7 @@ if(Python3_FOUND) message(STATUS "Found Python: " ${Python3_VERSION}) message(STATUS "Python libraries: " ${Python3_LIBRARIES}) message(STATUS "Python executable: " ${Python3_EXECUTABLE}) + message(STATUS "Python (arch-dependant) module destination: " ${Python3_SITEARCH}) endif() find_package(Boost COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} REQUIRED) @@ -41,17 +42,11 @@ if(USE_OPENMP) target_link_libraries(ocl PRIVATE OpenMP::OpenMP_CXX) endif() -execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "import site; print(site.getsitepackages()[-2])" - OUTPUT_VARIABLE PYTHON_ARCH_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -install(TARGETS ocl LIBRARY DESTINATION "${PYTHON_ARCH_PACKAGES}/opencamlib") +install(TARGETS ocl LIBRARY DESTINATION "${Python3_SITEARCH}/opencamlib") if(NOT SKBUILD) install( DIRECTORY pythonlib/opencamlib/ - DESTINATION "${PYTHON_ARCH_PACKAGES}/opencamlib" + DESTINATION "${Python3_SITEARCH}/opencamlib" ) endif()