1 | # |
---|
2 | # ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | # > www.orxonox.net < |
---|
4 | # |
---|
5 | # This program is free software; you can redistribute it and/or |
---|
6 | # modify it under the terms of the GNU General Public License |
---|
7 | # as published by the Free Software Foundation; either version 2 |
---|
8 | # of the License, or (at your option) any later version. |
---|
9 | # |
---|
10 | # This program is distributed in the hope that it will be useful, |
---|
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | # GNU General Public License for more details. |
---|
14 | # |
---|
15 | # You should have received a copy of the GNU General Public License along |
---|
16 | # with this program; if not, write to the Free Software Foundation, |
---|
17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
18 | # |
---|
19 | # |
---|
20 | # Author: |
---|
21 | # Reto Grieder |
---|
22 | # Description: |
---|
23 | # Configures the installation (paths, rpaths, options) |
---|
24 | # |
---|
25 | |
---|
26 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # Variable provided by CMake |
---|
27 | IF("$ENV{ORXONOX_DEV}" OR TARDIS) |
---|
28 | SET(_install_prefix_changed 1) |
---|
29 | SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH |
---|
30 | "Install path prefix, prepended onto install directories." FORCE) |
---|
31 | ENDIF() |
---|
32 | ENDIF() |
---|
33 | |
---|
34 | SET(_info_text "Puts all installed files in subfolders of the install prefix path. That root folder can then be moved, copied and renamed as you wish. The executable will not write to folders like ~/.orxonox or \"Applictation Data\"") |
---|
35 | IF(UNIX AND NOT _install_prefix_changed) |
---|
36 | OPTION(INSTALL_COPYABLE "${_info_text}" FALSE) |
---|
37 | ELSE() |
---|
38 | OPTION(INSTALL_COPYABLE "${_info_text}" TRUE) |
---|
39 | ENDIF() |
---|
40 | |
---|
41 | # Default installation paths |
---|
42 | SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH}) |
---|
43 | SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH}) |
---|
44 | SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH}) |
---|
45 | SET(MODULE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH}) |
---|
46 | SET(DOC_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH}) |
---|
47 | SET(DATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH}) |
---|
48 | SET(CONFIG_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH}) |
---|
49 | SET(LOG_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH}) |
---|
50 | |
---|
51 | IF(NOT INSTALL_COPYABLE) |
---|
52 | IF(UNIX) # Apple too? |
---|
53 | # Using absolute paths |
---|
54 | SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/games) |
---|
55 | SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox) |
---|
56 | SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static) |
---|
57 | SET(MODULE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules) |
---|
58 | SET(DOC_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox) |
---|
59 | SET(DATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/games/orxonox) |
---|
60 | ENDIF() |
---|
61 | |
---|
62 | # Leave empty because it is user and therefore runtime dependent |
---|
63 | SET(CONFIG_INSTALL_DIRECTORY) |
---|
64 | SET(LOG_INSTALL_DIRECTORY) |
---|
65 | ENDIF() |
---|
66 | |
---|
67 | ################## Unix rpath ################### |
---|
68 | |
---|
69 | # When building, don't use the install RPATH already |
---|
70 | # (but later on when installing) |
---|
71 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) |
---|
72 | |
---|
73 | # The RPATH to be used when installing |
---|
74 | IF(INSTALL_COPYABLE) |
---|
75 | SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH}) |
---|
76 | ELSE() |
---|
77 | SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY}) |
---|
78 | ENDIF() |
---|
79 | |
---|
80 | # Add the automatically determined parts of the RPATH |
---|
81 | # which point to directories outside the build tree to the install RPATH |
---|
82 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) |
---|