diff --git a/CMakeLists.txt b/CMakeLists.txt index 68cb2a730..1d3e61d2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,9 +75,11 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - if (NOT PYTHON_DEST) + set(PYTHON_INSTALL_DIR "" CACHE "Directory of the SIRF Python modules") + if (PYTHON_INSTALL_DIR) + set(PYTHON_DEST "${PYTHON_INSTALL_DIR }") + else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") - endif() message(STATUS "Python libraries found") message(STATUS "Location of Python modules: " ${PYTHON_DEST}) endif() @@ -86,10 +88,16 @@ endif() message(STATUS "Attempting to find MATLAB (This might launch MATLAB so might take a while)") FIND_PACKAGE(Matlab COMPONENTS MAIN_PROGRAM) set (BUILD_MATLAB ${Matlab_FOUND}) + if (BUILD_MATLAB) matlab_get_mex_suffix("${Matlab_ROOT_DIR}" MATLAB_MEX_EXT) - set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") - message(STATUS "MATLAB libraries found") + set(MATLAB_INSTALL_DIR "" CACHE "Directory of the SIRF Matlab libraries") + if (MATLAB_INSTALL_DIR) + set(MATLAB_DEST "${MATLAB_INSTALL_DIR }") + else() + set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") + message(STATUS "Matlab libraries found") + message(STATUS "Location of Matlab libraries: " ${MATLAB_DEST}) endif() if (NOT BUILD_MATLAB AND NOT BUILD_PYTHON)