# HG changeset patch # User koda # Date 1356618768 -3600 # Node ID 416cb5e5a405aef3a2d30db1d801d4493b55135b # Parent 217c3fd72a2dc8fd66d715a066d8214cc97c1827 move DATA_INSTALL_DIR to the configurable options section diff -r 217c3fd72a2d -r 416cb5e5a405 CMakeLists.txt --- a/CMakeLists.txt Thu Dec 27 13:24:57 2012 +0100 +++ b/CMakeLists.txt Thu Dec 27 15:32:48 2012 +0100 @@ -23,9 +23,11 @@ option(ANDROID "Enable Android build [default: off]" OFF) option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF) option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF) -set(FPFLAGS "" CACHE STRING "Additional Freepascal flags" FORCE) -set(GHFLAGS "" CACHE STRING "Additional Haskell flags" FORCE) - +set(FPFLAGS "" CACHE STRING "Additional Freepascal flags") +set(GHFLAGS "" CACHE STRING "Additional Haskell flags") +if(UNIX AND NOT APPLE) + set(DATA_INSTALL_DIR "share/hedgewars" CACHE STRING "Resource folder path") +endif() #detect Mercurial revision (if present) if(NOT NOREVISION) @@ -72,11 +74,7 @@ if(UNIX AND NOT APPLE) set(target_binary_install_dir "bin") set(target_library_install_dir "lib") - if(DEFINED DATA_INSTALL_DIR) - set(SHAREPATH "${DATA_INSTALL_DIR}/") - else() - set(SHAREPATH "share/hedgewars/") - endif() + set(SHAREPATH "${DATA_INSTALL_DIR}/") else() set(target_binary_install_dir "./") diff -r 217c3fd72a2d -r 416cb5e5a405 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Thu Dec 27 13:24:57 2012 +0100 +++ b/QTfrontend/CMakeLists.txt Thu Dec 27 15:32:48 2012 +0100 @@ -41,11 +41,12 @@ include_directories("/usr/local/include") endif(UNIX) -#directory for resources, relative to the one above on certain platforms/configurations -if(DEFINED DATA_INSTALL_DIR OR WIN32 OR APPLE) +#directory for resources, relative to bindir unless absolute path is used +string(FIND "${SHAREPATH}" "/" sharepath_is_absolute) +if(${sharepath_is_absolute} EQUAL 0) set(HEDGEWARS_DATADIR ${SHAREPATH}) else() - set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/${SHAREPATH}/) + set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/${SHAREPATH}) endif() #only the cocoa version of qt supports building 64 bit apps