Avoid using the $<CONFIG> based directory in .rc paths

The use of '/$<CONFIG>/' component in .rc path leads to undefined
behavior caused by CMake internal conflicts. Replace the path component
with the filename suffix.

Fixes: QTBUG-136019
Pick-to: 6.8 6.5
Change-Id: I73ae7f89ac65d00661148fcf41c973945bd2cc4f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7ce4a8a8c977688144efb94d41e20ed2420aa74b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2025-04-17 16:10:52 +02:00 committed by Qt Cherry-pick Bot
parent 4b20e23ed7
commit 4ea5f55aed

View File

@ -1583,10 +1583,11 @@ function(_qt_internal_generate_win32_rc_file target)
# Generate RC File
set(rc_file_output "${target_binary_dir}/")
if(QT_GENERATOR_IS_MULTI_CONFIG)
string(APPEND rc_file_output "$<CONFIG>/")
set(rc_file_suffix "-$<CONFIG>")
else()
set(rc_file_suffix "")
endif()
string(APPEND rc_file_output "${target}_resource.rc")
set(target_rc_file "${rc_file_output}")
string(APPEND rc_file_output "${target}_resource${rc_file_suffix}.rc")
set(company_name "")
get_target_property(target_company_name ${target} QT_TARGET_COMPANY_NAME)