From f76c3d42cc6acdf51405e977cc77e744befa9ece Mon Sep 17 00:00:00 2001 From: "K. R. Walker" Date: Mon, 22 Nov 2021 10:17:18 -0700 Subject: [PATCH] Make MOC depend on executable and parameters file It's unclear if all this is needed, but it seems to have resolved some build order issues for me. --- src/corelib/Qt6CoreMacros.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 13026a15201..3749bf5e7a9 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -133,7 +133,7 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options set(targetincludes "$<$:-I$\n>") set(targetdefines "$<$:-D$\n>") - file (GENERATE + file(GENERATE OUTPUT ${_moc_parameters_file} CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n" ) @@ -144,10 +144,9 @@ function(_qt_internal_create_moc_command infile outfile moc_flags moc_options file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n") endif() - set(_moc_extra_parameters_file @${_moc_parameters_file}) add_custom_command(OUTPUT ${outfile} ${extra_output_files} - COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::moc ${_moc_extra_parameters_file} - DEPENDS ${infile} ${moc_depends} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::moc @${_moc_parameters_file} + DEPENDS ${QT_CMAKE_EXPORT_NAMESPACE}::moc ${moc_parameters_file} ${infile} ${moc_depends} ${_moc_working_dir} VERBATIM) set_source_files_properties(${infile} PROPERTIES SKIP_AUTOMOC ON)