Skip to content

Commit

Permalink
[CMake] Move prebuilt package dl info to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Sep 8, 2023
1 parent 2038a13 commit baac221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ find_package(ZIP REQUIRED)
###########################
# Prebuilt package DL info

# terrain_overrides/high.wz
set(PREBUILT_TERRAIN_HIGH_DL_URL "https://github.com/Warzone2100/data-terrain-high/releases/download/v1/high.wz")
set(PREBUILT_TERRAIN_HIGH_DL_SHA512 "44a39e585344b25ab0fa4ed769f2b48bf23a0e4fc4b23e0fab4e68643cc6e3ebeabba790e8b1e6c96493ad01b6a2f09e92b893063013077dcac2475f0b5373d6")
include("WZPrebuiltPackages.cmake")

# Function to handle downloading package
function(WZ_FETCH_PREBUILT_PACKAGE PACKAGE_URL PACKAGE_FILENAME PACKAGE_SHA512 OUTPUT_PATH STATUS)
Expand Down Expand Up @@ -281,7 +279,7 @@ if (WZ_INCLUDE_TERRAIN_HIGH)
set(_build_package "OFF")
if (WZ_DOWNLOAD_PREBUILT_PACKAGES)
# Try to download the prebuilt package
WZ_FETCH_PREBUILT_PACKAGE("${PREBUILT_TERRAIN_HIGH_DL_URL}" "high.wz" "${PREBUILT_TERRAIN_HIGH_DL_SHA512}" "${CMAKE_CURRENT_BINARY_DIR}/terrain_overrides/high.wz" _dl_terrain_high_result)
WZ_FETCH_PREBUILT_PACKAGE("${WZ_PREBUILT_TERRAIN_HIGH_DL_URL}" "high.wz" "${WZ_PREBUILT_TERRAIN_HIGH_DL_SHA512}" "${CMAKE_CURRENT_BINARY_DIR}/terrain_overrides/high.wz" _dl_terrain_high_result)
if (NOT _dl_terrain_high_result)
# Download failed - WZ_FETCH_PREBUILT_PACKAGE already handles logging a message
set(_build_package "ON")
Expand Down
6 changes: 6 additions & 0 deletions data/WZPrebuiltPackages.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###########################
# Prebuilt package DL info

# terrain_overrides/high.wz
set(WZ_PREBUILT_TERRAIN_HIGH_DL_URL "https://github.com/Warzone2100/data-terrain-high/releases/download/v1/high.wz")
set(WZ_PREBUILT_TERRAIN_HIGH_DL_SHA512 "44a39e585344b25ab0fa4ed769f2b48bf23a0e4fc4b23e0fab4e68643cc6e3ebeabba790e8b1e6c96493ad01b6a2f09e92b893063013077dcac2475f0b5373d6")

0 comments on commit baac221

Please sign in to comment.