summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-12 14:34:11 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-04-12 16:08:16 +0000
commit4a730fa0b08c68fc01f35b79a43fdd72411f2b83 (patch)
treec43a1ed2b7d9fdcd0092e773b2cf0483650ed940 /src
parent95598e0fa90f369ee4b9e7dc125cb33d5c7b4e49 (diff)
downloadmana-4a730fa0b08c68fc01f35b79a43fdd72411f2b83.tar.gz
mana-4a730fa0b08c68fc01f35b79a43fdd72411f2b83.tar.bz2
mana-4a730fa0b08c68fc01f35b79a43fdd72411f2b83.tar.xz
mana-4a730fa0b08c68fc01f35b79a43fdd72411f2b83.zip
CMake: Use GNUInstallDirs
This should make CMake options a little more standardized. The Windows part could potentially still be unified further. Absolute paths are now only used for the defines and not for values going to install() commands.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt10
-rw-r--r--src/client.cpp3
2 files changed, 9 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b7300e46..72b44ac6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,8 +18,14 @@ IF (CMAKE_COMPILER_IS_GNUCXX)
ENDIF()
SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
-SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
-SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
+
+IF (WIN32)
+ SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
+ SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${CMAKE_INSTALL_LOCALEDIR}/\\\"")
+ELSE()
+ SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${CMAKE_INSTALL_FULL_DATAROOTDIR}/mana/\\\"")
+ SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${CMAKE_INSTALL_FULL_LOCALEDIR}/\\\"")
+ENDIF()
IF (ENABLE_MANASERV)
INCLUDE_DIRECTORIES("../libs/enet/include")
diff --git a/src/client.cpp b/src/client.cpp
index 6fd73d4f..6e12a579 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -274,12 +274,11 @@ Client::Client(const Options &options):
}
CFRelease(resourcesURL);
strncat(path, "/data", PATH_MAX - 1);
- resman->addToSearchPath(path, false);
mPackageDir = path;
#else
- resman->addToSearchPath(PKG_DATADIR "data", false);
mPackageDir = PKG_DATADIR "data";
#endif
+ resman->addToSearchPath(mPackageDir, false);
resman->addToSearchPath("data", false);