-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")
-if(EXISTS ${MINETEST_GAME_SOURCE} AND IS_DIRECTORY ${MINETEST_GAME_SOURCE})
- install(FILES ${MINETEST_GAME_SOURCE}/game.conf DESTINATION "${SHAREDIR}/games/minetest_game/")
- install(FILES ${MINETEST_GAME_SOURCE}/README.txt DESTINATION "${SHAREDIR}/games/minetest_game/")
- install(DIRECTORY ${MINETEST_GAME_SOURCE}/mods DESTINATION "${SHAREDIR}/games/minetest_game")
+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}")
+ if(NOT RUN_IN_PLACE)
+ set(EXAMPLE_CONF_DIR ${DOCDIR})
+ endif()
+ 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}")