From 0738e862cb63fbcc560ea4e37478c006cf50882c Mon Sep 17 00:00:00 2001 From: eroen Date: Mon, 22 Sep 2014 15:36:42 +0200 Subject: [PATCH] Make GLOBAL_CONFIG_PATH, GLOBAL_DATA_PATH configurable --- CMakeLists.txt | 8 +++++--- components/CMakeLists.txt | 10 ++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c226a27b..f86368e33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -401,14 +401,16 @@ IF(NOT WIN32 AND NOT APPLE) SET(BINDIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Where to install binaries") SET(LIBDIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Where to install libraries") SET(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE PATH "Sets the root of data directories to a non-default location") - SET(DATADIR "${DATAROOTDIR}/games/openmw" CACHE PATH "Sets the openmw data directories to a non-default location") + SET(GLOBAL_DATA_PATH "${DATAROOTDIR}/games/" CACHE PATH "Set data path prefix") + SET(DATADIR "${GLOBAL_DATA_PATH}/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.") IF("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr") - SET(SYSCONFDIR "/etc/openmw" CACHE PATH "Set config dir") + SET(GLOBAL_CONFIG_PATH "/etc/" CACHE PATH "Set config dir prefix") ELSE() - SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc/openmw" CACHE PATH "Set config dir") + SET(GLOBAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/etc/" CACHE PATH "Set config dir prefix") ENDIF() + SET(SYSCONFDIR "${GLOBAL_CONFIG_PATH}/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 8b967336c..fffcaa70b 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -57,12 +57,10 @@ add_component_dir (misc utf8stream stringops resourcehelpers ) -add_definitions(-DGLOBAL_DATA_PATH="${CMAKE_INSTALL_PREFIX}/share/games/") -if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr") - add_definitions(-DGLOBAL_CONFIG_PATH="/etc/") -else() - add_definitions(-DGLOBAL_CONFIG_PATH="${CMAKE_INSTALL_PREFIX}/etc/") -endif() +IF(NOT WIN32 AND NOT APPLE) + add_definitions(-DGLOBAL_DATA_PATH="${GLOBAL_DATA_PATH}") + add_definitions(-DGLOBAL_CONFIG_PATH="${GLOBAL_CONFIG_PATH}") +ENDIF() add_component_dir (files linuxpath androidpath windowspath macospath fixedpath multidircollection collections configurationmanager constrainedfiledatastream lowlevelfile