@@ -23,7 +23,7 @@ if(NOT APPLE)
2323endif ()
2424option (WITH_WEBSOCKET "Allow connecting to MUME over WebSockets" OFF )
2525option (WITH_QTKEYCHAIN "Use QtKeychain to securely store your account credentials" OFF )
26- option (WITH_MAP "Download the default map" ON )
26+ option (WITH_MAP "Download the default map or use the provided map path " ON )
2727option (WITH_TESTS "Compile unit tests" ON )
2828option (USE_TIDY "Run clang-tidy with the compiler" OFF )
2929option (USE_IWYU "Run include-what-you-use with the compiler" OFF )
@@ -379,33 +379,7 @@ endif()
379379
380380# Download arda.mm2
381381if (WITH_MAP)
382- set (MMAPPER_MAP_FILE "${CMAKE_BINARY_DIR} /map/arda.mm2" )
383- if (NOT EXISTS ${MMAPPER_MAP_FILE} )
384- set (MMAPPER_MAP_URL "https://github.com/MUME/MMapper/releases/download/v${MMAPPER_VERSION} /arda.mm2" )
385- message (STATUS "Fetching MMapper Map from: ${MMAPPER_MAP_URL} " )
386-
387- file (DOWNLOAD ${MMAPPER_MAP_URL} ${MMAPPER_MAP_FILE} STATUS MMAPPER_MAP_HTTP_STATUS)
388- list (GET MMAPPER_MAP_HTTP_STATUS 0 MMAPPER_MAP_STATUS)
389-
390- if (MMAPPER_MAP_STATUS)
391- file (REMOVE ${MMAPPER_MAP_FILE} )
392- if (GIT_LAST_ANNOTATED_TAG)
393- set (MMAPPER_MAP_URL "https://github.com/MUME/MMapper/releases/download/${GIT_LAST_ANNOTATED_TAG} /arda.mm2" )
394- message (STATUS "Map not found. Fetching alternative map from: ${MMAPPER_MAP_URL} " )
395- file (DOWNLOAD ${MMAPPER_MAP_URL} ${MMAPPER_MAP_FILE} STATUS MMAPPER_MAP_HTTP_STATUS)
396- list (GET MMAPPER_MAP_HTTP_STATUS 0 MMAPPER_MAP_STATUS)
397- endif ()
398- endif ()
399-
400- if (MMAPPER_MAP_STATUS)
401- file (REMOVE ${MMAPPER_MAP_FILE} )
402- message (FATAL_ERROR "Unable to download map: use `-DWITH_MAP=OFF` to not require a map" )
403- else ()
404- message (STATUS "Downloaded map to: ${MMAPPER_MAP_FILE} " )
405- endif ()
406- else ()
407- message (STATUS "Using cached MMapper map: ${MMAPPER_MAP_FILE} " )
408- endif ()
382+ add_subdirectory (external/map)
409383else ()
410384 message (STATUS "Building without default map as a resource" )
411385 add_definitions (/DMMAPPER_NO_MAP)
0 commit comments