From 04ffc5ef04343d7d8e5490bc0f00068f54793a5b Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 9 Feb 2022 19:18:01 +0100 Subject: Changed order of adding the files to datafile archives --- cmake/modules/AddDatafile.cmake | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'cmake') 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} - $ $ -mak COMMENT "Creating datafile ${DATAFILE_TARGET}" ) foreach(RESOURCE_TARGET IN ITEMS ${DATAFILE_RESOURCES}) @@ -66,5 +61,14 @@ function(add_datafile) $ $ -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} + $ $ -mak + ) add_custom_target(${DATAFILE_TARGET} ALL DEPENDS ${DATAFILE_OUTPUT}) endfunction() -- cgit v1.1