summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-05-20 13:22:28 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-05-20 19:40:46 +0200
commit9e8f43e5accba52b3df6e202759f5ea9b8620e5e (patch)
tree8dfdef0c398ad87fdcb337f79baaf4f5d4c45ca9
parentc4df673dd9034bc6dcd0871d27f13d8524ae829e (diff)
Fix qt6_add_big_resources
The qt6_add_big_resources command was dysfunctional whenever AUTOMOC was enabled for a target. We passed multiple object files with the --temp argument of the second pass of rcc. We must pass exactly one. The spurious object file was the one that's created by AUTOMOC. Turn off all of AUTOGEN for the C++ source file that's generated in the first pass of rcc. Enable AUTOMOC for tests/auto/cmake/test_add_big_resource to cover this situation. Pick-to: 6.1 Fixes: QTBUG-85051 Change-Id: I6d2ce4953297db0751913456db0a4a126fe33f14 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/corelib/Qt6CoreMacros.cmake2
-rw-r--r--tests/auto/cmake/test_add_big_resource/CMakeLists.txt4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 73a2db1b25..96b25b4ad9 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -389,7 +389,7 @@ function(qt6_add_big_resources outfiles )
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.o)
_qt6_parse_qrc_file(${infile} _out_depends _rc_depends)
- set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
+ set_source_files_properties(${infile} PROPERTIES SKIP_AUTOGEN ON)
add_custom_command(OUTPUT ${tmpoutfile}
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile}
DEPENDS ${infile} ${_rc_depends} "${out_depends}" ${QT_CMAKE_EXPORT_NAMESPACE}::rcc
diff --git a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
index f9014aac06..49abde6650 100644
--- a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
@@ -1,8 +1,10 @@
-
cmake_minimum_required(VERSION 3.14)
project(test_add_big_resource)
+# Make sure that AUTOMOC does not interfere with qt_add_big_resources
+set(CMAKE_AUTOMOC ON)
+
find_package(Qt6Core REQUIRED)
qt_wrap_cpp(moc_files myobject.h)