language correction 'flyingvalkyrie' > 'flying_valkyrie'
[megaglest-data.git] / CMakeLists.txt
blob92ae77ec7da950931c7828c05c533e73c399cd41
1 ##################################################################################
2 # Game data
3 CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
4 PROJECT( MegaGlest )
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)")
14         ENDIF()
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)")
17         ENDIF()
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)")
20         ENDIF()
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)")
23         ENDIF()
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)")
26         ENDIF()
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)")
29         ENDIF()
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}")
36         ENDIF()
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})
58                 ENDIF()
59         ENDIF()
60         IF(UNIX AND NOT "${MEGAGLEST_MENU_INSTALL_PATH}" STREQUAL "")
61                 INSTALL(FILES
62                         "${PROJECT_BINARY_DIR}/others/menu/megaglest"
63                         DESTINATION ${MEGAGLEST_MENU_INSTALL_PATH})
64         ENDIF()
66         IF(UNIX AND NOT APPLE)
67                 INSTALL(FILES
68                         "${PROJECT_SOURCE_DIR}/others/icons/megaglest.png"
69                         "${PROJECT_SOURCE_DIR}/others/icons/megaglest.xpm"
70                         DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
72                 INSTALL(FILES
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)
76                         INSTALL(FILES
77                                 "${PROJECT_SOURCE_DIR}/others/desktop/megaglest_editor.desktop"
78                                 DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
79                 ENDIF()
80                 IF(BUILD_MEGAGLEST_MODEL_VIEWER OR NOT DEFINED BUILD_MEGAGLEST_MODEL_VIEWER)
81                         INSTALL(FILES
82                                 "${PROJECT_SOURCE_DIR}/others/desktop/megaglest_g3dviewer.desktop"
83                                 DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
84                 ENDIF()
85         ENDIF()
86 ENDIF()