From 4ea5f55aed0b66d266d9efa895d7bc8fe6d59f5f Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Thu, 17 Apr 2025 16:10:52 +0200 Subject: [PATCH] Avoid using the $ based directory in .rc paths The use of '/$/' 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 (cherry picked from commit 7ce4a8a8c977688144efb94d41e20ed2420aa74b) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/Qt6CoreMacros.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 1125097f977..1cb836af1e8 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -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 "$/") + set(rc_file_suffix "-$") + 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)