From 26a2b29246859f0d2603d7258f5633c54d74cd77 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Tue, 28 Jul 2015 14:46:27 +0200 Subject: [PATCH] Download game packs --- CMakeLists.txt | 7 +++++++ Makefile | 2 +- install-gamepacks.sh | 9 +++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d744cc3..e4087305 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,3 +383,10 @@ if(NOT (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)) file(COPY ${DATA_FILES} DESTINATION "${CMAKE_BINARY_DIR}/docs") endif() +option(DOWNLOAD_GAMEPACKS "Download game packs" ON) +if(DOWNLOAD_GAMEPACKS) + add_custom_target(game_packs ALL + COMMAND ${CMAKE_COMMAND} -E make_directory games + COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/install-gamepacks.sh" "${CMAKE_BINARY_DIR}" + ) +endif() diff --git a/Makefile b/Makefile index e4ae3fed..0be77698 100644 --- a/Makefile +++ b/Makefile @@ -662,7 +662,7 @@ $(INSTALLDIR)/radiant.$(EXE): \ radiant/mainframe.o \ radiant/main.o \ radiant/map.o \ - $(if $(findstring $(OS),Win32),radiant/multimon.o,) \ + radiant/multimon.o \ radiant/mru.o \ radiant/nullmodel.o \ radiant/parse.o \ diff --git a/install-gamepacks.sh b/install-gamepacks.sh index f4ae8428..2e3723da 100755 --- a/install-gamepacks.sh +++ b/install-gamepacks.sh @@ -4,15 +4,16 @@ : ${SH:=sh} : ${CP:=cp} : ${CP_R:=cp -r} +: ${SOURCE_DIR:=.} dest=$1 case "$DOWNLOAD_GAMEPACKS" in yes) - LICENSEFILTER=GPL BATCH=1 $SH download-gamepacks.sh + LICENSEFILTER=GPL BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh" ;; all) - BATCH=1 $SH download-gamepacks.sh + BATCH=1 $SH "$SOURCE_DIR/download-gamepacks.sh" ;; *) ;; @@ -22,9 +23,9 @@ set -e for GAME in games/*; do if [ "$GAME" = "games/*" ]; then $ECHO "Game packs not found, please run" - $ECHO " ./download-gamepacks.sh" + $ECHO " $SOURCE_DIR/download-gamepacks.sh" $ECHO "and then try again!" else - $SH install-gamepack.sh "$GAME" "$dest" + $SH "$SOURCE_DIR/install-gamepack.sh" "$GAME" "$dest" fi done -- 2.39.2