python build BUGFIX do not use --root when installing without DESTDIR set
the --root option removes leading / from prefix even if its value is
empty (no DESTDIR set) and the python module is then installed locally.
@@ -22,5 +22,9 @@ if (PYTHON)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Makefile.in ${CMAKE_CURRENT_SOURCE_DIR}/docs/Makefile)
add_custom_target(pyapi ALL COMMAND ${PYTHON} ${SETUP_PY} build -b ${PYAPI_BUILD_DIR} ${DEBUG})
add_custom_target(pyapidoc COMMAND make -f ${CMAKE_CURRENT_SOURCE_DIR}/docs/Makefile html)
+ if(\$ENV{DESTDIR})
install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} build -b ${PYAPI_BUILD_DIR} install --root=\$ENV{DESTDIR} --prefix=${CMAKE_INSTALL_PREFIX})")
+ else()
+ install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} build -b ${PYAPI_BUILD_DIR} install --prefix=${CMAKE_INSTALL_PREFIX})")
+ endif()
endif()
