summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-05-20 18:15:49 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-05-22 22:32:27 +0200
commit895edcd7cdcf47ec9238d42db742f81c5c2eaeb9 (patch)
treebe46b9c41709e0ca7e8de6e57be76e283a1ae939 /src
parentecbf6c5b00aca0792f0b73344f5e9810900682a7 (diff)
Support multiple equally named .qrc files in qt_add_big_resources
It is now possible to call qt_add_big_resources with multiple .qrc files that are in different directories but have the same file name. Before, this resulted in target name conflict errors. Pick-to: 6.1 Fixes: QTBUG-93230 Change-Id: Ic3d9d6974a107163aeb7ada0b6f1fa113fb18de0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt6CoreMacros.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 2fd6d3a18c..a46f1689de 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -384,6 +384,19 @@ function(qt6_add_big_resources outfiles )
foreach(it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
+
+ # Provide unique targets and output file names
+ # in case we add multiple .qrc files with the same base name.
+ string(MAKE_C_IDENTIFIER "_qt_big_resource_count_${outfilename}" prop)
+ get_property(count GLOBAL PROPERTY ${prop})
+ if(count)
+ string(APPEND outfilename "_${count}")
+ else()
+ set(count 0)
+ endif()
+ math(EXPR count "${count} + 1")
+ set_property(GLOBAL PROPERTY ${prop} ${count})
+
get_filename_component(infile ${it} ABSOLUTE)
set(tmpoutfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}tmp.cpp)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.o)