summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AddDatafile.cmake18
1 files changed, 11 insertions, 7 deletions
diff --git a/cmake/modules/AddDatafile.cmake b/cmake/modules/AddDatafile.cmake
index f54b892..6b5baf8 100644
--- a/cmake/modules/AddDatafile.cmake
+++ b/cmake/modules/AddDatafile.cmake
@@ -12,7 +12,8 @@
# target name with ".dat" suffix.
#
# 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.
+# additional directories with files that will also get included in the final datafile. In case of conflicts, files from
+# source tree will be used.
#
# To create the archive the Datafile.exe is used - for non-Windows platforms an emulator that can run it is required.
@@ -45,13 +46,7 @@ function(add_datafile)
endif()
add_custom_command(
OUTPUT ${DATAFILE_OUTPUT}
- DEPENDS ${DATAFILE_SOURCE}
COMMAND ${CMAKE_COMMAND} -E rm -f ${DATAFILE_OUTPUT}
- COMMAND
- ${CMAKE_COMMAND} -E chdir ${DATAFILE_SOURCE}
- ${CMAKE_COMMAND} -E env "${DATAFILE_VAR}='${DATAFILE_PATHS}'"
- ${CMAKE_CORSSCOMPILING_EMULATOR}
- $<TARGET_FILE:Datafile> $<SHELL_PATH:${DATAFILE_OUTPUT}> -mak
COMMENT "Creating datafile ${DATAFILE_TARGET}"
)
foreach(RESOURCE_TARGET IN ITEMS ${DATAFILE_RESOURCES})
@@ -66,5 +61,14 @@ function(add_datafile)
$<TARGET_FILE:Datafile> $<SHELL_PATH:${DATAFILE_OUTPUT}> -mak
)
endforeach()
+ add_custom_command(
+ OUTPUT ${DATAFILE_OUTPUT} APPEND
+ DEPENDS ${DATAFILE_SOURCE}
+ COMMAND
+ ${CMAKE_COMMAND} -E chdir ${DATAFILE_SOURCE}
+ ${CMAKE_COMMAND} -E env "${DATAFILE_VAR}='${DATAFILE_PATHS}'"
+ ${CMAKE_CORSSCOMPILING_EMULATOR}
+ $<TARGET_FILE:Datafile> $<SHELL_PATH:${DATAFILE_OUTPUT}> -mak
+ )
add_custom_target(${DATAFILE_TARGET} ALL DEPENDS ${DATAFILE_OUTPUT})
endfunction()