From a5d3b5b61bd6979e52daa0d60ba2247287b44afa Mon Sep 17 00:00:00 2001 From: Florian Rathgeber Date: Thu, 9 Feb 2017 13:02:18 +0000 Subject: [PATCH] ECC-106 Respect INSTALL_{BIN,DATA,INSTALL,LIB}_DIR when installing Python modules --- python/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index a895480a0..4c80f2ebf 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -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()