| 1 | Install the Python package into DESTDIR without build isolation.
|
| 2 |
|
| 3 | |
| 4 | |
| 5 | @@ -28,11 +28,21 @@ install(CODE [[
|
| 6 | if(NOT _pip_check EQUAL 0)
|
| 7 | message(WARNING "Skipping Python package install: pip not available for ${Python3_EXECUTABLE}.")
|
| 8 | else()
|
| 9 | + set(_pip_install_args
|
| 10 | + install
|
| 11 | + --no-deps
|
| 12 | + --no-build-isolation
|
| 13 | + --break-system-packages
|
| 14 | + --prefix ${CMAKE_INSTALL_PREFIX})
|
| 15 | + if(DEFINED ENV{DESTDIR} AND NOT "$ENV{DESTDIR}" STREQUAL "")
|
| 16 | + list(APPEND _pip_install_args --root "$ENV{DESTDIR}")
|
| 17 | + endif()
|
| 18 | + list(APPEND _pip_install_args .)
|
| 19 | execute_process(
|
| 20 | - COMMAND ${Python3_EXECUTABLE} -m pip install --no-deps --break-system-packages .
|
| 21 | + COMMAND ${Python3_EXECUTABLE} -m pip ${_pip_install_args}
|
| 22 | - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
|
| 23 | + WORKING_DIRECTORY $ENV{PWD}/build/python
|
| 24 | OUTPUT_VARIABLE _pip_output
|
| 25 | ERROR_VARIABLE _pip_error
|
| 26 | RESULT_VARIABLE _pip_result)
|
| 27 |
|
| 28 | if(_pip_result EQUAL 0)
|