diff options
author | Michal Suchanek <hramrach@gmail.com> | 2012-05-07 16:07:16 +0200 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2012-05-12 12:11:22 +0100 |
commit | 96851e094e4e9f07cd3c95c924f86dc94dfd9dfd (patch) | |
tree | ea37718913e1fe7a4c293826138437d9b76d4989 /CMakeLists.txt | |
parent | 3db3b2f03af32da02faa59b9bcbdd0e2879e280a (diff) |
Add multiarch support.
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 70ebd872..61a3a337 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,21 +202,37 @@ endif () # also avoids missing/inconsistent declarations in system headers. include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khronos) + ############################################################################## # Installation directories +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # Debian multiarch support + execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH + OUTPUT_VARIABLE ARCH_SUBDIR + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() + if (WIN32 OR APPLE) # On Windows/MacOSX, applications are usually installed on a directory of # their own set (DOC_INSTALL_DIR doc) set (LIB_INSTALL_DIR lib) + set (LIB_ARCH_INSTALL_DIR lib) else () set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME}) set (LIB_INSTALL_DIR lib/${CMAKE_PROJECT_NAME}) + if (ARCH_SUBDIR) + set (LIB_ARCH_INSTALL_DIR lib/${ARCH_SUBDIR}/${CMAKE_PROJECT_NAME}) + else () + set (LIB_ARCH_INSTALL_DIR lib/${CMAKE_PROJECT_NAME}) + endif () endif () set (SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts) -set (WRAPPER_INSTALL_DIR ${LIB_INSTALL_DIR}/wrappers) +set (WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers) # Expose the binary/install directories to source # @@ -226,7 +242,8 @@ set (WRAPPER_INSTALL_DIR ${LIB_INSTALL_DIR}/wrappers) add_definitions( -DAPITRACE_BINARY_DIR="${CMAKE_BINARY_DIR}" -DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" - -DAPITRACE_LIB_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" + -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}" + -DAPITRACE_WRAPPERS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}" ) |