From: Mattia Basaglia Date: Tue, 28 Jul 2015 16:44:07 +0000 (+0200) Subject: Download game packs only when needed by default X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=be699d5c0c1804de81da3b84c1a26e18e8d578b2;p=xonotic%2Fnetradiant.git Download game packs only when needed by default With an option to disable automatic downloads, and a target to download them manually. This avoids having to download them every time you make all. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ba2fcc8e..d3026bc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -390,9 +390,15 @@ if(NOT (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)) endif() option(DOWNLOAD_GAMEPACKS "Download game packs" ON) +add_custom_target(game_packs + 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}" + COMMENT "Downloading game packs" +) +add_custom_command(OUTPUT games + COMMAND make game_packs + DEPENDS download-gamepacks.sh install-gamepacks.sh install-gamepack.sh +) 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}" - ) + add_custom_target(game_packs_all ALL DEPENDS games) endif()