Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
better support for absolute paths in the cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
filux committed Apr 1, 2017
1 parent 32a8f45 commit 7385926
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,33 @@ OPTION(WANT_INSTALL_DATA "Install MegaGlest's data" ON)
IF(NOT CMAKE_INSTALL_PREFIX STREQUAL "" AND WANT_INSTALL_DATA)
MESSAGE(STATUS "**Data package INSTALL triggered.")

SET(COMMON_INFO_ABOUT_PATH "(if the path is relative then is appended to the CMAKE_INSTALL_PREFIX)")
IF(NOT MEGAGLEST_DATA_INSTALL_PATH)
SET(MEGAGLEST_DATA_INSTALL_PATH "share/megaglest/" CACHE STRING "The installation path for data files (this is appended to the CMAKE_INSTALL_PREFIX)")
SET(MEGAGLEST_DATA_INSTALL_PATH "share/megaglest/" CACHE STRING "The installation path for data files ${COMMON_INFO_ABOUT_PATH}")
ENDIF()
IF(NOT MEGAGLEST_APPDATA_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_APPDATA_INSTALL_PATH "share/appdata/" CACHE STRING "The installation path for appdata files (this is appended to the CMAKE_INSTALL_PREFIX)")
SET(MEGAGLEST_APPDATA_INSTALL_PATH "share/appdata/" CACHE STRING "The installation path for appdata files ${COMMON_INFO_ABOUT_PATH}")
ENDIF()
IF(NOT MEGAGLEST_DESKTOP_INSTALL_PATH)
SET(MEGAGLEST_DESKTOP_INSTALL_PATH "share/applications/" CACHE STRING "The installation path for desktop files (this is appended to the CMAKE_INSTALL_PREFIX)")
SET(MEGAGLEST_DESKTOP_INSTALL_PATH "share/applications/" CACHE STRING "The installation path for desktop files ${COMMON_INFO_ABOUT_PATH}")
ENDIF()
IF(NOT MEGAGLEST_ICON_INSTALL_PATH)
SET(MEGAGLEST_ICON_INSTALL_PATH "share/pixmaps/" CACHE STRING "The installation path for icon files (this is appended to the CMAKE_INSTALL_PREFIX)")
SET(MEGAGLEST_ICON_INSTALL_PATH "share/pixmaps/" CACHE STRING "The installation path for icon files ${COMMON_INFO_ABOUT_PATH}")
ENDIF()
IF(NOT MEGAGLEST_BIN_INSTALL_PATH)
SET(MEGAGLEST_BIN_INSTALL_PATH "bin/" CACHE STRING "The installation path for binaries (this is appended to the CMAKE_INSTALL_PREFIX)")
SET(MEGAGLEST_BIN_INSTALL_PATH "bin/" CACHE STRING "The installation path for binaries ${COMMON_INFO_ABOUT_PATH}")
ENDIF()
IF(NOT MEGAGLEST_MENU_INSTALL_PATH AND NOT WANT_SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_MENU_INSTALL_PATH "share/menu/" CACHE STRING "The installation path for menu file (this is appended to the CMAKE_INSTALL_PREFIX)")
SET(MEGAGLEST_MENU_INSTALL_PATH "share/menu/" CACHE STRING "The installation path for menu file ${COMMON_INFO_ABOUT_PATH}")
ENDIF()
FOREACH(MG_PATH BIN ICON)
IF(IS_ABSOLUTE "${MEGAGLEST_${MG_PATH}_INSTALL_PATH}")
SET(MEGAGLEST_FULL_${MG_PATH}_INSTALL_PATH "${MEGAGLEST_${MG_PATH}_INSTALL_PATH}/")
ELSE()
SET(MEGAGLEST_FULL_${MG_PATH}_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_${MG_PATH}_INSTALL_PATH}/")
ENDIF()
STRING(REGEX REPLACE "//+" "/" MEGAGLEST_FULL_${MG_PATH}_INSTALL_PATH "${MEGAGLEST_FULL_${MG_PATH}_INSTALL_PATH}")
ENDFOREACH()

CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/others/menu/megaglest.menu.in"
"${PROJECT_BINARY_DIR}/others/menu/megaglest.menu.in" COPYONLY)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
MegaGlest (http://megaglest.org) is a libre software cross
platform real-time strategy game.

[![logo](http://megaglest.org/uploads/megaglest2011/logo/logo.png)]
(http://megaglest.org/)
![logo](http://megaglest.org/uploads/megaglest2011/logo/logo.png)

> Repository contains data such as:
> * maps, scenarios, tutorials
Expand Down
2 changes: 1 addition & 1 deletion data/lang/gaelic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ LoadGameLoadingFile=A' feuchainn ri faidhle a luchdadh: '%s'
SavedGameBadVersion=Chan eil tionndadh a' gheama air a shàbhaladh a' freagairt ri tionndadh na h-aplacaid agad:\n[%s] --> [%s]
LoadSavedGameInfo=Mapa: %s\nLeacagan: %s\nTeicneolas: %s\nCnàmh-sgeul: %s\nCluicheadairean: %d\nBuidheann: %s
LoadedSpeed=Luaths le eallach
Loading=Ga luchdadh
Loading=A' luchdadh
LocalTime=Ionadail:
LogScreenCoreDataLoading=Dàta eitein
LogScreenGameLoading=Geama
Expand Down
4 changes: 2 additions & 2 deletions others/menu/megaglest.menu.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
section="Games/Strategy" \
title="MegaGlest" \
longtitle="MegaGlest, a 3D real time strategy game." \
command="@CMAKE_INSTALL_PREFIX@/@MEGAGLEST_BIN_INSTALL_PATH@megaglest" \
icon="@CMAKE_INSTALL_PREFIX@/@MEGAGLEST_ICON_INSTALL_PATH@megaglest.xpm"
command="@MEGAGLEST_FULL_BIN_INSTALL_PATH@megaglest" \
icon="@MEGAGLEST_FULL_ICON_INSTALL_PATH@megaglest.xpm"
4 changes: 2 additions & 2 deletions others/menu/megaglest_editor.menu.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
section="Games/Tools" \
title="MegaGlest Map Editor" \
longtitle="MegaGlest Map Editor, a game tool for 3D real time strategy game: MegaGlest." \
command="@CMAKE_INSTALL_PREFIX@/@MEGAGLEST_BIN_INSTALL_PATH@megaglest_editor" \
icon="@CMAKE_INSTALL_PREFIX@/@MEGAGLEST_ICON_INSTALL_PATH@megaglest.xpm"
command="@MEGAGLEST_FULL_BIN_INSTALL_PATH@megaglest_editor" \
icon="@MEGAGLEST_FULL_ICON_INSTALL_PATH@megaglest.xpm"

0 comments on commit 7385926

Please sign in to comment.