Skip to content

Commit 58f83ab

Browse files
committed
build/cmake: python cleanup
1 parent 6151ee8 commit 58f83ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ configure_file(README.md README.md COPYONLY)
88
find_package(Python3 REQUIRED COMPONENTS Interpreter)
99

1010
add_custom_target(python
11-
COMMAND ${Python3_EXECUTABLE} -m build .
11+
COMMAND ${Python3_EXECUTABLE} -m build "${CMAKE_CURRENT_BINARY_DIR}"
1212
DEPENDS opendht opendht_cpp.pxd opendht.pyx pyproject.toml
1313
${CURRENT_SOURCE_DIR}/opendht/__init__.py
1414
${CURRENT_SOURCE_DIR}/opendht/aio.py)
1515

1616
install(CODE [[
1717
execute_process(
18-
COMMAND "${Python3_EXECUTABLE}" -m pip install --no-deps --break-system-packages .
18+
COMMAND "${Python3_EXECUTABLE}" -m pip install --no-deps --break-system-packages "${CMAKE_CURRENT_BINARY_DIR}"
1919
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
20+
OUTPUT_VARIABLE _pip_output
21+
ERROR_VARIABLE _pip_output
2022
RESULT_VARIABLE _pip_result)
23+
message(STATUS ${_pip_output})
2124
if(NOT _pip_result EQUAL 0)
2225
message(FATAL_ERROR "pip install failed with code ${_pip_result}")
2326
endif()

0 commit comments

Comments
 (0)