summaryrefslogtreecommitdiff
path: root/indra/cmake/UnixInstall.cmake
blob: 59620b60b4d47034117b45613268de35ca1347e4 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
if (NOT ${viewer_VERSION})
  MESSAGE(FATAL_ERROR "Viewer version not known!")
endif (NOT ${viewer_VERSION})

set(INSTALL OFF CACHE BOOL
    "Generate install target.")

if (INSTALL)

  if (DARWIN)

    set(INSTALL_PREFIX
        ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents
        CACHE PATH
        "Top-level installation directory.")

    set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/Resources
        CACHE PATH
        "Installation directory for read-only shared files.")

    set(INSTALL_SHARE_DIR ${INSTALL_LIBRARY_DIR} CACHE PATH
        "Installation directory for read-only shared files.")

    set(APP_BINARY_DIR ${INSTALL_PREFIX}/MacOS
        CACHE PATH
        "Installation directory for binaries.")

    set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}
        CACHE PATH
        "Installation directory for read-only data files.")

    set(APP_LIBEXEC_DIR ${INSTALL_LIBRARY_DIR}
        CACHE PATH
        "Installation directory for non-manual executables.")

  else (DARWIN)

    set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH
        "Top-level installation directory.")

    if (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu)
      set(_LIB lib/${ARCH}-linux-gnu)
    elseif (EXISTS /lib64)
      set(_LIB lib64)
    else ()
      set(_LIB lib)
    endif ()

    set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH
        "Installation directory for read-only shared files.")

    set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH
        "Installation directory for read-only shared files.")

    set(APP_BINARY_DIR ${INSTALL_PREFIX}/bin
        CACHE PATH
        "Installation directory for binaries.")

    set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME}
        CACHE PATH
        "Installation directory for read-only data files.")

    set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME}
        CACHE PATH
        "Installation directory for non-manual executables.")

  endif (DARWIN)

endif (INSTALL)