diff options
author | Christian Mollekopf <mollekopf@kolabsys.com> | 2012-03-23 11:15:05 (GMT) |
---|---|---|
committer | Christian Mollekopf <mollekopf@kolabsys.com> | 2012-03-23 11:15:05 (GMT) |
commit | 4720ce81abc54aa6b034012db3cbf87f4d567db1 (patch) | |
tree | 60cd23f1884e8691fb7b214b1cc5ef2cd47f98d0 /cmake | |
parent | 0c74f1cb96e49cc9ec8e821eec3124f37265d65b (diff) | |
download | libkolabxml-4720ce81abc54aa6b034012db3cbf87f4d567db1.tar.gz |
Install libraries to the correct (64bit) directory. Make it possible to override the determined path.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindKolabInternal.cmake | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/cmake/modules/FindKolabInternal.cmake b/cmake/modules/FindKolabInternal.cmake new file mode 100644 index 0000000..1ccf0d5 --- /dev/null +++ b/cmake/modules/FindKolabInternal.cmake @@ -0,0 +1,44 @@ + +# The install directory is defined by the CMAKE_INSTALL_PREFIX which defaults to /usr/local if not specified. +# To install i.e. to /usr use "cmake -DCMAKE_INSTALL_PREFIX=/usr ." +# +# The library directory suffix (64/32) is detected automatically based on the available directories in CMAKE_INSTALL_PREFIX +# The Result of this can be overridden by setting KOLAB_LIB_INSTALL_DIR "cmake -DKOLAB_LIB_INSTALL_DIR=/usr/lib64/ ." +# +# The runtime install is controlled by KOLAB_BIN_INSTALL_DIR +# +# KOLAB_INSTALL_DIRECTORIES contains the determined install directories and should be used with install commands + +get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + +if (${LIB64} STREQUAL "TRUE") + find_path(LIB32FOUND "${CMAKE_INSTALL_PREFIX}/lib32") + find_path(LIB64FOUND "${CMAKE_INSTALL_PREFIX}/lib64") + if (LIB64FOUND) + set(LIBSUFFIX 64) + else() + set(LIBSUFFIX "") + endif() +else() + set(LIBSUFFIX "") +endif() + +if(KOLAB_LIB_INSTALL_DIR) + message("KOLAB_LIB_INSTALL_DIR specified manually") +else() + set(KOLAB_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}") +endif() +message("KOLAB_LIB_INSTALL_DIR: ${KOLAB_LIB_INSTALL_DIR}") + +if(KOLAB_BIN_INSTALL_DIR) + message("KOLAB_BIN_INSTALL_DIR specified manually") +else() + set(KOLAB_BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") +endif() +message("KOLAB_BIN_INSTALL_DIR: ${KOLAB_BIN_INSTALL_DIR}") + +set(KOLAB_INSTALL_DIRECTORIES RUNTIME DESTINATION "${KOLAB_BIN_INSTALL_DIR}" + LIBRARY DESTINATION "${KOLAB_LIB_INSTALL_DIR}" + ARCHIVE DESTINATION "${KOLAB_LIB_INSTALL_DIR}" COMPONENT Devel ) + +set(KOLAB_HEADER_INSTALL_DIR "${INCLUDE_INSTALL_DIR}/kolab") |