summaryrefslogtreecommitdiff
path: root/cmake/modules/FindKolabInternal.cmake
blob: 19ba440f5d0a9e27e5ffaab555bb964e8b52aa18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

# 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
# The header install is controlled by KOLAB_HEADER_INSTALL_DIR
#
# KOLAB_INSTALL_DIRECTORIES contains the determined install directories and should be used with install commands

if (LIB_INSTALL_DIR)
    set(KOLAB_LIB_INSTALL_DIR ${LIB_INSTALL_DIR})
else ()
    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()
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 )


if(KOLAB_HEADER_INSTALL_DIR)
    message("KOLAB_HEADER_INSTALL_DIR specified manually")
else()
    set(KOLAB_HEADER_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include/kolab")
endif()
message("KOLAB_HEADER_INSTALL_DIR: ${KOLAB_HEADER_INSTALL_DIR}")