1 ##################################################################################
3 CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
6 OPTION(WANT_INSTALL_DATA "Install MegaGlest's data" ON)
8 # Requires an install prefix for the items below to work
9 IF(NOT CMAKE_INSTALL_PREFIX STREQUAL "" AND WANT_INSTALL_DATA)
10 MESSAGE(STATUS "**Data package INSTALL triggered.")
12 IF(NOT MEGAGLEST_DATA_INSTALL_PATH)
13 SET(MEGAGLEST_DATA_INSTALL_PATH "share/megaglest/" CACHE STRING "The installation path for data files (this is appended to the CMAKE_INSTALL_PREFIX)")
15 IF(NOT MEGAGLEST_APPDATA_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
16 SET(MEGAGLEST_APPDATA_INSTALL_PATH "share/appdata/" CACHE STRING "The installation path for appdata files (this is appended to the CMAKE_INSTALL_PREFIX)")
18 IF(NOT MEGAGLEST_DESKTOP_INSTALL_PATH)
19 SET(MEGAGLEST_DESKTOP_INSTALL_PATH "share/applications/" CACHE STRING "The installation path for desktop files (this is appended to the CMAKE_INSTALL_PREFIX)")
21 IF(NOT MEGAGLEST_ICON_INSTALL_PATH)
22 SET(MEGAGLEST_ICON_INSTALL_PATH "share/pixmaps/" CACHE STRING "The installation path for icon files (this is appended to the CMAKE_INSTALL_PREFIX)")
24 IF(NOT MEGAGLEST_BIN_INSTALL_PATH)
25 SET(MEGAGLEST_BIN_INSTALL_PATH "bin/" CACHE STRING "The installation path for binaries (this is appended to the CMAKE_INSTALL_PREFIX)")
27 IF(NOT MEGAGLEST_MENU_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
28 SET(MEGAGLEST_MENU_INSTALL_PATH "share/menu/" CACHE STRING "The installation path for menu file (this is appended to the CMAKE_INSTALL_PREFIX)")
31 CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/others/menu/megaglest.menu.in"
32 "${PROJECT_BINARY_DIR}/others/menu/megaglest.menu.in" COPYONLY)
33 IF(BUILD_MEGAGLEST_MAP_EDITOR OR NOT DEFINED BUILD_MEGAGLEST_MAP_EDITOR)
34 FILE(READ "${PROJECT_SOURCE_DIR}/others/menu/megaglest_editor.menu.in" EDITOR_MENU)
35 FILE(APPEND "${PROJECT_BINARY_DIR}/others/menu/megaglest.menu.in" "${EDITOR_MENU}")
37 CONFIGURE_FILE("${PROJECT_BINARY_DIR}/others/menu/megaglest.menu.in"
38 "${PROJECT_BINARY_DIR}/others/menu/megaglest")
40 # Installation of the data
41 INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/data"
42 "${PROJECT_SOURCE_DIR}/docs"
43 "${PROJECT_SOURCE_DIR}/maps"
44 "${PROJECT_SOURCE_DIR}/scenarios"
45 "${PROJECT_SOURCE_DIR}/techs"
46 "${PROJECT_SOURCE_DIR}/tilesets"
47 "${PROJECT_SOURCE_DIR}/tutorials"
48 DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}
49 OPTIONAL REGEX "/.git" EXCLUDE)
51 IF(UNIX AND NOT "${MEGAGLEST_APPDATA_INSTALL_PATH}" STREQUAL "")
52 INSTALL(FILES "${PROJECT_SOURCE_DIR}/others/appdata/megaglest.appdata.xml"
53 DESTINATION ${MEGAGLEST_APPDATA_INSTALL_PATH})
55 IF(BUILD_MEGAGLEST_MAP_EDITOR OR NOT DEFINED BUILD_MEGAGLEST_MAP_EDITOR)
56 INSTALL(FILES "${PROJECT_SOURCE_DIR}/others/appdata/megaglest_editor.appdata.xml"
57 DESTINATION ${MEGAGLEST_APPDATA_INSTALL_PATH})
60 IF(UNIX AND NOT "${MEGAGLEST_MENU_INSTALL_PATH}" STREQUAL "")
62 "${PROJECT_BINARY_DIR}/others/menu/megaglest"
63 DESTINATION ${MEGAGLEST_MENU_INSTALL_PATH})
66 IF(UNIX AND NOT APPLE)
68 "${PROJECT_SOURCE_DIR}/others/icons/megaglest.png"
69 "${PROJECT_SOURCE_DIR}/others/icons/megaglest.xpm"
70 DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
73 "${PROJECT_SOURCE_DIR}/others/desktop/megaglest.desktop"
74 DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
75 IF(BUILD_MEGAGLEST_MAP_EDITOR OR NOT DEFINED BUILD_MEGAGLEST_MAP_EDITOR)
77 "${PROJECT_SOURCE_DIR}/others/desktop/megaglest_editor.desktop"
78 DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
80 IF(BUILD_MEGAGLEST_MODEL_VIEWER OR NOT DEFINED BUILD_MEGAGLEST_MODEL_VIEWER)
82 "${PROJECT_SOURCE_DIR}/others/desktop/megaglest_g3dviewer.desktop"
83 DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})