From 2ae8158ee9aaa75a7089ea81beee7f4a87c19719 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Fri, 19 Sep 2014 03:15:28 +0200 Subject: [PATCH] SYSCONFDIR and LinuxPath should work with different install prefixs --- CMakeLists.txt | 2 +- components/CMakeLists.txt | 1 + components/files/linuxpath.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2252ec9da..21114a2a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -401,7 +401,7 @@ IF(NOT WIN32 AND NOT APPLE) SET(DATADIR "${DATAROOTDIR}/games/openmw" CACHE PATH "Sets the openmw data directories to a non-default location") SET(ICONDIR "${DATAROOTDIR}/pixmaps" CACHE PATH "Set icon dir") SET(LICDIR "${DATAROOTDIR}/licenses/openmw" CACHE PATH "Sets the openmw license directory to a non-default location.") - SET(SYSCONFDIR "/etc/openmw" CACHE PATH "Set config dir") + SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc/openmw" CACHE PATH "Set config dir") # Install binaries INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw" DESTINATION "${BINDIR}" ) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index f5e31190e..b7c64e0c6 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -57,6 +57,7 @@ add_component_dir (misc utf8stream stringops resourcehelpers ) +add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") add_component_dir (files linuxpath androidpath windowspath macospath fixedpath multidircollection collections configurationmanager constrainedfiledatastream lowlevelfile diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp index 1c87537ba..990fd2637 100644 --- a/components/files/linuxpath.cpp +++ b/components/files/linuxpath.cpp @@ -69,7 +69,7 @@ boost::filesystem::path LinuxPath::getCachePath() const boost::filesystem::path LinuxPath::getGlobalConfigPath() const { - boost::filesystem::path globalPath("/etc/"); + boost::filesystem::path globalPath(INSTALL_PREFIX "/etc/"); return globalPath / mName; } @@ -80,7 +80,7 @@ boost::filesystem::path LinuxPath::getLocalPath() const boost::filesystem::path LinuxPath::getGlobalDataPath() const { - boost::filesystem::path globalDataPath("/usr/share/games/"); + boost::filesystem::path globalDataPath(INSTALL_PREFIX "/share/games/"); return globalDataPath / mName; }