From e5f0fec762771733e9cbc9a29cade7533f49d802 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 18 Mar 2019 11:29:16 +0100 Subject: Fix disabling AUTOMOC and AUTOUIC for generated resource cpp files when using qt5_add_big_resources. The previous approach of just setting SKIP_AUTOMOC and SKIP_AUTOUIC on the generated source files is not enough because if AUTOMOC is globally enabled, AUTOMOC will still run for the rcc_object_{outfilename} target, which ends up creating a mos_compilation.cpp.o file and adding it as a target object to the target. Thus later when $ is passed to the rcc invocation, the expression evaluates to a list of two files: the rcc-related .o file and the mocs_compilation.o file. Obviously that breaks the rcc invocation. The fix is to disable AUTOMOC and AUTOUIC on the whole target, instead of just the source files. This prevents the creation of the mocs_compilation.cpp file. Fixes: QTBUG-74270 Change-Id: I51f757b110e940fe224010acb25b88c52ef612b1 Reviewed-by: Kai Koehne --- src/corelib/Qt5CoreMacros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/Qt5CoreMacros.cmake') diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 620795d2cf..7ae5e4fd16 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -321,10 +321,10 @@ function(QT5_ADD_BIG_RESOURCES outfiles ) add_custom_command(OUTPUT ${tmpoutfile} COMMAND ${Qt5Core_RCC_EXECUTABLE} ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile} DEPENDS ${infile} ${_rc_depends} "${out_depends}" VERBATIM) - set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_AUTOMOC ON) - set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_AUTOUIC ON) add_custom_target(big_resources_${outfilename} ALL DEPENDS ${tmpoutfile}) add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile}) + set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOMOC OFF) + set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOUIC OFF) add_dependencies(rcc_object_${outfilename} big_resources_${outfilename}) add_custom_command(OUTPUT ${outfile} COMMAND ${Qt5Core_RCC_EXECUTABLE} -- cgit v1.2.3