aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt57
1 files changed, 49 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc903721b..6f6d1111b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ if(WIN32)
elseif(APPLE)
# Random placeholders; this isn't usually used and may not work
# See https://github.com/toabi/minetest-mac/
- set(SHAREDIR "share/${PROJECT_NAME}")
+ set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
set(BINDIR "bin")
set(DOCDIR "share/doc/${PROJECT_NAME}")
set(EXAMPLE_CONF_DIR ${DOCDIR})
@@ -78,17 +78,58 @@ elseif(UNIX) # Linux, BSD etc
set(ICONDIR "unix/icons")
set(LOCALEDIR "locale")
else()
- set(SHAREDIR "share/${PROJECT_NAME}")
- set(BINDIR "bin")
- set(DOCDIR "share/doc/${PROJECT_NAME}")
- set(MANDIR "share/man")
+ set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
+ set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
+ set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
+ set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
set(EXAMPLE_CONF_DIR ${DOCDIR})
- set(XDG_APPS_DIR "share/applications")
- set(ICONDIR "share/icons")
- set(LOCALEDIR "share/locale")
+ set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
+ set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
+ set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
endif()
endif()
+set(CUSTOM_SHAREDIR "" CACHE STRING "Directory to install data files into")
+if(NOT CUSTOM_SHAREDIR STREQUAL "")
+ set(SHAREDIR "${CUSTOM_SHAREDIR}")
+ message(STATUS "Using SHAREDIR=${SHAREDIR}")
+endif()
+set(CUSTOM_BINDIR "" CACHE STRING "Directory to install binaries into")
+if(NOT CUSTOM_BINDIR STREQUAL "")
+ set(BINDIR "${CUSTOM_BINDIR}")
+ message(STATUS "Using BINDIR=${BINDIR}")
+endif()
+set(CUSTOM_DOCDIR "" CACHE STRING "Directory to install documentation into")
+if(NOT CUSTOM_DOCDIR STREQUAL "")
+ set(DOCDIR "${CUSTOM_DOCDIR}")
+ message(STATUS "Using DOCDIR=${DOCDIR}")
+endif()
+set(CUSTOM_MANDIR "" CACHE STRING "Directory to install manpages into")
+if(NOT CUSTOM_MANDIR STREQUAL "")
+ set(MANDIR "${CUSTOM_MANDIR}")
+ message(STATUS "Using MANDIR=${MANDIR}")
+endif()
+set(CUSTOM_EXAMPLE_CONF_DIR "" CACHE STRING "Directory to install example config file into")
+if(NOT CUSTOM_EXAMPLE_CONF_DIR STREQUAL "")
+ set(EXAMPLE_CONF_DIR "${CUSTOM_EXAMPLE_CONF_DIR}")
+ message(STATUS "Using EXAMPLE_CONF_DIR=${EXAMPLE_CONF_DIR}")
+endif()
+set(CUSTOM_XDG_APPS_DIR "" CACHE STRING "Directory to install .desktop files into")
+if(NOT CUSTOM_XDG_APPS_DIR STREQUAL "")
+ set(XDG_APPS_DIR "${CUSTOM_XDG_APPS_DIR}")
+ message(STATUS "Using XDG_APPS_DIR=${XDG_APPS_DIR}")
+endif()
+set(CUSTOM_ICONDIR "" CACHE STRING "Directory to install icons into")
+if(NOT CUSTOM_ICONDIR STREQUAL "")
+ set(ICONDIR "${CUSTOM_ICONDIR}")
+ message(STATUS "Using ICONDIR=${ICONDIR}")
+endif()
+set(CUSTOM_LOCALEDIR "" CACHE STRING "Directory to install l10n files into")
+if(NOT CUSTOM_LOCALEDIR STREQUAL "")
+ set(LOCALEDIR "${CUSTOM_LOCALEDIR}")
+ message(STATUS "Using LOCALEDIR=${LOCALEDIR}")
+endif()
+
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/builtin" DESTINATION "${SHAREDIR}")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minimal" DESTINATION "${SHAREDIR}/games")
set(MINETEST_GAME_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game")