From 465949420a877099247d94dd4db54d19ca5a9a7c Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Fri, 31 Jan 2020 14:44:52 +0100 Subject: Update add_custom_command and add_custom_target dependencies If we don't add the executable used by the custom_target and/or custom_command to list of the command's/target's dependencies (DEPENDS) the generated file will not update should the executable change. Change-Id: Idce30f3dd4f756d9e8f6848c5e16f5dd6c7c8f0a Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtResource.cmake.in | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'cmake/QtResource.cmake.in') diff --git a/cmake/QtResource.cmake.in b/cmake/QtResource.cmake.in index 2f8f77eb79..84a275bc67 100644 --- a/cmake/QtResource.cmake.in +++ b/cmake/QtResource.cmake.in @@ -102,13 +102,15 @@ function(__qt_quick_compiler_process_resources target resource_name) endif() add_custom_command( OUTPUT ${compiled_file} - DEPENDS ${file_absolute} ${QT_TOOL_PATH_SETUP_COMMAND} COMMAND @QT_CMAKE_EXPORT_NAMESPACE@::qmlcachegen - --resource-path ${file_resource_path} - -o ${compiled_file} - ${file_absolute} + --resource-path "${file_resource_path}" + -o "${compiled_file}" + "${file_absolute}" + DEPENDS + $ + "${file_absolute}" ) target_sources(${target} PRIVATE ${compiled_file}) endforeach() @@ -136,14 +138,16 @@ function(__qt_quick_compiler_process_resources target resource_name) add_custom_command( OUTPUT ${qmlcache_loader_file} - DEPENDS ${qmlcache_loader_list} ${QT_TOOL_PATH_SETUP_COMMAND} COMMAND @QT_CMAKE_EXPORT_NAMESPACE@::qmlcachegen ${retained_args} --resource-name "${resource_name_arg}" - -o ${qmlcache_loader_file} + -o "${qmlcache_loader_file}" "@${qmlcache_loader_list}" + DEPENDS + $ + "${qmlcache_loader_list}" ) __qt_propagate_generated_resource(${target} @@ -293,7 +297,10 @@ function(QT@PROJECT_VERSION_MAJOR@_PROCESS_RESOURCE target resourceName) add_custom_command(OUTPUT "${generatedSourceCode}" COMMAND "@QT_CMAKE_EXPORT_NAMESPACE@::rcc" ARGS ${rccArgs} - DEPENDS ${resource_dependencies} ${generatedResourceFile} + DEPENDS + ${resource_dependencies} + ${generatedResourceFile} + "@QT_CMAKE_EXPORT_NAMESPACE@::rcc" COMMENT "RCC ${newResourceName}" VERBATIM) -- cgit v1.2.3