From 38d97a6ee370c841c082f0b2f676f1e36ebc6169 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Mon, 15 Jul 2019 18:50:52 +0100 Subject: [PATCH] Add cmake download replays. fix win download --- CMakeLists.txt | 12 +++++++++++- openrct2.proj | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34a22049d5..93461d31e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# CMAKE project for openrct2 +# CMAKE project for openrct2 cmake_minimum_required(VERSION 3.9) if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") @@ -26,11 +26,15 @@ set(TITLE_SEQUENCE_SHA1 "19263f8ca383345959473e64da4785a60f00f420") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v1.0.11/objects.zip") set(OBJECTS_SHA1 "8674120086929f9196560d77cada631fb478d7c0") +set(REPLAYS_URL "https://github.com/OpenRCT2/objects/releases/download/v1.0.11/objects.zip") +set(REPLAYS_SHA1 "8612DACA1FFE63BE4731C048CCB2411C5C45E9B4") + option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") option(PORTABLE "Create a portable build (-rpath=$ORIGIN)" OFF) option(DOWNLOAD_TITLE_SEQUENCES "Download title sequences during installation." ON) option(DOWNLOAD_OBJECTS "Download objects during installation." ON) +option(DOWNLOAD_REPLAYS "Download replays during installation." ON) # Options option(STATIC "Create a static build.") @@ -287,6 +291,12 @@ if (DOWNLOAD_OBJECTS) file(REMOVE \$ENV{DESTDIR}/${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT}/object/objects.zip)\n\ endif ()") endif () +if (DOWNLOAD_REPLAYS) + set(REPLAY_DIR "\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT}/testdata/replays") + install(CODE "file(DOWNLOAD ${REPLAYS_URL} ${REPLAY_DIR}/replays.zip EXPECTED_HASH SHA1=${REPLAYS_SHA1} SHOW_PROGRESS)") + install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir ${REPLAY_DIR}/ \"${CMAKE_COMMAND}\" -E tar xvf replays.zip)") + install(CODE "file(REMOVE ${REPLAY_DIR}/replays.zip)") +endif () install(TARGETS "libopenrct2" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") if(NOT DISABLE_GUI) diff --git a/openrct2.proj b/openrct2.proj index e538bfcda4..ca03dc325f 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -73,7 +73,7 @@ https://github.com/OpenRCT2/objects/releases/download/v1.0.11/objects.zip 8674120086929f9196560d77cada631fb478d7c0 https://github.com/OpenRCT2/replays/releases/download/v0.0.1/replays.zip - 8612DACA1FFE63BE4731C048CCB2411C5C45E9B4 + 8612DACA1FFE63BE4731C048CCB2411C5C45E9B4