From 58f83ab3c663beaef5e26cd186137b55010ac695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Fri, 5 Sep 2025 00:35:28 -0400 Subject: [PATCH] build/cmake: python cleanup --- python/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 2ed1bdf9..07850a30 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -8,16 +8,19 @@ configure_file(README.md README.md COPYONLY) find_package(Python3 REQUIRED COMPONENTS Interpreter) add_custom_target(python - COMMAND ${Python3_EXECUTABLE} -m build . + COMMAND ${Python3_EXECUTABLE} -m build "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS opendht opendht_cpp.pxd opendht.pyx pyproject.toml ${CURRENT_SOURCE_DIR}/opendht/__init__.py ${CURRENT_SOURCE_DIR}/opendht/aio.py) install(CODE [[ execute_process( - COMMAND "${Python3_EXECUTABLE}" -m pip install --no-deps --break-system-packages . + COMMAND "${Python3_EXECUTABLE}" -m pip install --no-deps --break-system-packages "${CMAKE_CURRENT_BINARY_DIR}" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + OUTPUT_VARIABLE _pip_output + ERROR_VARIABLE _pip_output RESULT_VARIABLE _pip_result) + message(STATUS ${_pip_output}) if(NOT _pip_result EQUAL 0) message(FATAL_ERROR "pip install failed with code ${_pip_result}") endif()