build/cmake: python cleanup

This commit is contained in:
Adrien Béraud committed 2025-09-05 00:35:28 -04:00
1 parent 6151ee8c0b
commit 58f83ab3c6
1 file changed
+5 -2
+5 -2
View File
@@ -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()