From 64de90a97717ff04b8de7c069e8ce22f18e51641 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Fri, 21 Oct 2022 11:20:47 +0200 Subject: [PATCH] Make Sure that `qml_compile_hash_p.h` Isn't Missing In the event of an unexpected build directory corruption, CMake may fail to replace/install the `qml_compiler_hash_p.h` properly. I have had similar errors with other files missing as well, so this fix might be applicable to elsewhere as well. Pick-to: 6.4 Change-Id: Ife3e28a09296b5428d0f0248648caabda601c94d Reviewed-by: Alexey Edelev --- cmake/QtDeclarativeSetup.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtDeclarativeSetup.cmake b/cmake/QtDeclarativeSetup.cmake index 6559b7b4c8..6f39befa26 100644 --- a/cmake/QtDeclarativeSetup.cmake +++ b/cmake/QtDeclarativeSetup.cmake @@ -10,6 +10,8 @@ function(qt_declarative_write_tag_header target_name) set(out_file "${CMAKE_CURRENT_BINARY_DIR}/qml_compile_hash_p.h") if(FEATURE_developer_build AND EXISTS "${out_file}") + target_sources(${target_name} PRIVATE "${out_file}") + set_source_files_properties("${out_file}" PROPERTIES GENERATED TRUE) return() endif()