summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authornia <29542929+alarixnia@users.noreply.github.com>2021-09-26 16:04:30 +0000
committerGitHub <noreply@github.com>2021-09-26 18:04:30 +0200
commit2dc73d239a42218fcf4de7b21f2898f0935b96b1 (patch)
treee9f0a5b7e3c7f45baf0688adc0295bbf21bc1f9d /CMakeLists.txt
parentbc7d05581b55756f6e4af4b311c30e2f6077a044 (diff)
downloadminetest-2dc73d239a42218fcf4de7b21f2898f0935b96b1.tar.gz
minetest-2dc73d239a42218fcf4de7b21f2898f0935b96b1.tar.bz2
minetest-2dc73d239a42218fcf4de7b21f2898f0935b96b1.zip
Use CMake's GNUInstallDirs for install directories on Unix (#11636)
This makes the installation process honor system-specific directories (e.g. ${PREFIX}/man instead of ${PREFIX}/share/man on BSD).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 9 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1995f34b8..e542d3509 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,15 +135,16 @@ elseif(UNIX) # Linux, BSD etc
set(ICONDIR "unix/icons")
set(LOCALEDIR "locale")
else()
- 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")
+ include(GNUInstallDirs)
+ set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}")
+ set(BINDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
+ set(DOCDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}")
+ set(MANDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_MANDIR}")
set(EXAMPLE_CONF_DIR ${DOCDIR})
- set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
- set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo")
- set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
- set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
+ set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/applications")
+ set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/metainfo")
+ set(ICONDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/icons")
+ set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALEDIR}")
endif()
endif()