From 23e3f94f731f384c630e72cd79dd68273c287793 Mon Sep 17 00:00:00 2001 From: Paul Sutton Date: Wed, 6 Jan 2016 15:54:46 +0000 Subject: [PATCH] Fix for lib64 systems --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a7381c65..d5f2a45b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,18 @@ option(DisableMEX "DisableMEX" ON) ######################################################################## # Install Dirs ######################################################################## +if (NOT CMAKE_INSTALL_LIBDIR) + include(GNUInstallDirs) +endif (NOT CMAKE_INSTALL_LIBDIR) + +# Fall back to just "lib" if the item provided by GNUInstallDirs doesn't exist +if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + message(STATUS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} does not exist. Defaulting install location to ${CMAKE_INSTALL_PREFIX}/lib.") + set(CMAKE_INSTALL_LIBDIR lib) +endif() + SET(RUNTIME_DIR bin) -SET(LIBRARY_DIR lib) +SET(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) SET(INCLUDE_DIR include) SET(MEX_DIR mex) SET(DOC_DIR "share/doc/${CPACK_PACKAGE_NAME}")