diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-01-31 14:53:04 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2020-02-03 08:06:46 +0000 |
commit | 366049b97fbcca2f9b0c513ad7e556a04734d224 (patch) | |
tree | 5db3597efcbd5966737e1073d79560f09d11478a /src/qml/Qt6QmlMacros.cmake | |
parent | 0933441b6d840f25f1c7f6c5c76f6f5457ad3a8a (diff) |
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: I5b33ab5aeea65daf0fb9f8802073b362d9c28742
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 0bccadf783..a3778512e1 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -502,6 +502,7 @@ function(qt6_qml_type_registration target) set(foreign_types_file_tmp "${foreign_types_file}.tmp") add_custom_target(${target}_resolve_foreign_types BYPRODUCTS "${foreign_types_file}" + DEPENDS "${QT_QMTYPES_RESOLVE_DEPENDENCIES_SCRIPT}" COMMAND ${CMAKE_COMMAND} -DOUTPUT_FILE:PATH="${foreign_types_file_tmp}" ${foreign_types_common_args} @@ -516,6 +517,7 @@ function(qt6_qml_type_registration target) else() add_custom_command( OUTPUT "${foreign_types_file}" + DEPENDS "${QT_QMTYPES_RESOLVE_DEPENDENCIES_SCRIPT}" COMMAND ${CMAKE_COMMAND} -DOUTPUT_FILE:PATH="${foreign_types_file}" ${foreign_types_common_args} @@ -551,7 +553,10 @@ function(qt6_qml_type_registration target) endif() add_custom_command(OUTPUT ${type_registration_cpp_file} - DEPENDS ${foreign_types_file} ${target_metatypes_json_file} + DEPENDS + ${foreign_types_file} + ${target_metatypes_json_file} + ${QT_CMAKE_EXPORT_NAMESPACE}::qmltyperegistrar COMMAND ${CMAKE_COMMAND} -E env PATH=${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR} $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qmltyperegistrar> |