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
Issue: #1768
  • Loading branch information
amadio committed Nov 11, 2022
1 parent 4cd7be5 commit e5fee52
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,25 @@ if ( NOT ${VALID_PIP_EXIT_CODE} EQUAL 0 )
set(DEB_INSTALL_ARGS "--install-layout ${PYTHON_LAYOUT}")
endif()

install(
CODE
"EXECUTE_PROCESS(
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}
)"
)

--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(
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}
)"
)
${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 e5fee52

Please sign in to comment.