From 7d6fa1b65a828f700170fbaa4f25af090f4cd3bc Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 2 Dec 2015 16:14:04 +0100 Subject: [PATCH] CMakeLists.txt: Don't use DATADIR before it's defined --- CMakeLists.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5106db666..498b43961 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,18 +83,6 @@ if (MSVC) option(OPENMW_LTO_BUILD "Build OpenMW with Link-Time Optimization (Needs ~2GB of RAM)" OFF) endif() -# Location of morrowind data files -if (APPLE) - set(MORROWIND_DATA_FILES "./data" CACHE PATH "location of Morrowind data files") - set(OPENMW_RESOURCE_FILES "./resources" CACHE PATH "location of OpenMW resources files") -elseif(UNIX) - set(MORROWIND_DATA_FILES "${DATADIR}/data" CACHE PATH "location of Morrowind data files") - set(OPENMW_RESOURCE_FILES "${DATADIR}/resources" CACHE PATH "location of OpenMW resources files") -else() - set(MORROWIND_DATA_FILES "data" CACHE PATH "location of Morrowind data files") - set(OPENMW_RESOURCE_FILES "resources" CACHE PATH "location of OpenMW resources files") -endif(APPLE) - if (WIN32) option(USE_DEBUG_CONSOLE "whether a debug console should be enabled for debug builds, if false debug output is redirected to Visual Studio output" ON) endif() @@ -436,6 +424,18 @@ IF(NOT WIN32 AND NOT APPLE) INSTALL(DIRECTORY DESTINATION "${DATADIR}/data" COMPONENT "Resources") ENDIF(NOT WIN32 AND NOT APPLE) +# Location of morrowind data files +if (APPLE) + set(MORROWIND_DATA_FILES "./data" CACHE PATH "location of Morrowind data files") + set(OPENMW_RESOURCE_FILES "./resources" CACHE PATH "location of OpenMW resources files") +elseif(UNIX) + set(MORROWIND_DATA_FILES "${DATADIR}/data" CACHE PATH "location of Morrowind data files") + set(OPENMW_RESOURCE_FILES "${DATADIR}/resources" CACHE PATH "location of OpenMW resources files") +else() + set(MORROWIND_DATA_FILES "data" CACHE PATH "location of Morrowind data files") + set(OPENMW_RESOURCE_FILES "resources" CACHE PATH "location of OpenMW resources files") +endif(APPLE) + if(WIN32) FILE(GLOB dll_files "${OpenMW_BINARY_DIR}/Release/*.dll") INSTALL(FILES ${dll_files} DESTINATION ".")