]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Download game packs only when needed by default
authorMattia Basaglia <mattia.basaglia@gmail.com>
Tue, 28 Jul 2015 16:44:07 +0000 (18:44 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Tue, 28 Jul 2015 16:44:07 +0000 (18:44 +0200)
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.

CMakeLists.txt

index ba2fcc8e8e23f0f0a0f7c761a30b522cb6208852..d3026bc19adf8423e44ae74c4929daaa2f4b1016 100644 (file)
@@ -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()