Skip to content

Commit

Permalink
[Python] Show install command and error out when pip install fails
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Dec 1, 2022
1 parent 7e1ad9d commit 9e55d03
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,29 @@ if ( NOT ${VALID_PIP_EXIT_CODE} EQUAL 0 )
install(
CODE
"EXECUTE_PROCESS(
COMMAND_ECHO STDOUT
RESULT_VARIABLE INSTALL_STATUS
COMMAND /usr/bin/env ${XROOTD_PYBUILD_ENV} ${PYTHON_EXECUTABLE} ${SETUP_PY} install \
--verbose \
--prefix \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX} \
${DEB_INSTALL_ARGS}
)"
)

)
if(NOT INSTALL_STATUS EQUAL 0)
message(FATAL_ERROR \"Failed to install Python bindings\")
endif()
")
else()
install(
CODE
"EXECUTE_PROCESS(
COMMAND_ECHO STDOUT
RESULT_VARIABLE INSTALL_STATUS
COMMAND /usr/bin/env ${XROOTD_PYBUILD_ENV} ${PYTHON_EXECUTABLE} -m pip install \
${PIP_OPTIONS} \
${CMAKE_CURRENT_BINARY_DIR}
)"
)
)
if(NOT INSTALL_STATUS EQUAL 0)
message(FATAL_ERROR \"Failed to install Python bindings\")
endif()
")
endif()

0 comments on commit 9e55d03

Please sign in to comment.