ECC-106 Respect INSTALL_{BIN,DATA,INSTALL,LIB}_DIR when installing Python modules

This commit is contained in:
Florian Rathgeber 2017-02-09 13:02:18 +00:00
parent f175bf0bfb
commit a5d3b5b61b
1 changed files with 8 additions and 2 deletions

View File

@ -55,8 +55,14 @@ if( HAVE_PYTHON )
configure_file( swig_wrap_numpy.py gribapi/gribapi_swig.py COPYONLY )
# Build the extension module for use in install tree with RPATH pointing to install tree
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext --rpath ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext --rpath ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
# Call distutils for installation
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install --root \$ENV{DESTDIR}/ --prefix ${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install --root \$ENV{DESTDIR}/ --prefix ${CMAKE_INSTALL_PREFIX}
--install-lib ${ECCODES_FULL_INSTALL_LIB_DIR}
--install-header ${ECCODES_FULL_INSTALL_INCLUDE_DIR}
--install-scripts ${ECCODES_FULL_INSTALL_BIN_DIR}
--install-data ${ECCODES_FULL_INSTALL_DATA_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
endif()