summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddDatafile.cmake10
-rw-r--r--cmake/modules/AddDownloadableResource.cmake2
2 files changed, 9 insertions, 3 deletions
diff --git a/cmake/modules/AddDatafile.cmake b/cmake/modules/AddDatafile.cmake
index 6b5baf8..f68ad04 100644
--- a/cmake/modules/AddDatafile.cmake
+++ b/cmake/modules/AddDatafile.cmake
@@ -13,7 +13,7 @@
#
# Optionally, RESOURCES can be used to specify binary resource targets from AddDownloadableResource that will provide
# additional directories with files that will also get included in the final datafile. In case of conflicts, files from
-# source tree will be used.
+# source tree will be used. This is to allow working with binary assets located in source directory.
#
# To create the archive the Datafile.exe is used - for non-Windows platforms an emulator that can run it is required.
@@ -61,9 +61,15 @@ function(add_datafile)
$<TARGET_FILE:Datafile> $<SHELL_PATH:${DATAFILE_OUTPUT}> -mak
)
endforeach()
+ file(
+ GLOB_RECURSE DATAFILE_DEPENDENCIES
+ LIST_DIRECTORIES true
+ CONFIGURE_DEPENDS
+ "${DATAFILE_SOURCE}/*"
+ )
add_custom_command(
OUTPUT ${DATAFILE_OUTPUT} APPEND
- DEPENDS ${DATAFILE_SOURCE}
+ DEPENDS ${DATAFILE_DEPENDENCIES}
COMMAND
${CMAKE_COMMAND} -E chdir ${DATAFILE_SOURCE}
${CMAKE_COMMAND} -E env "${DATAFILE_VAR}='${DATAFILE_PATHS}'"
diff --git a/cmake/modules/AddDownloadableResource.cmake b/cmake/modules/AddDownloadableResource.cmake
index d0374ad..9d00f58 100644
--- a/cmake/modules/AddDownloadableResource.cmake
+++ b/cmake/modules/AddDownloadableResource.cmake
@@ -69,7 +69,7 @@ function(add_downloadable_resource)
)
add_custom_command(
OUTPUT ${RESOURCE_DIRECTORY}
- DEPENDS download_${RESOURCE_TARGET}
+ DEPENDS download_${RESOURCE_TARGET} ${RESOURCE_ARCHIVE}
COMMENT "Unpacking ${RESOURCE_TARGET}"
COMMAND ${CMAKE_COMMAND} -E make_directory ${RESOURCE_DIRECTORY}
COMMAND