From a60d42d873e67281e5e30bcaa3daa2f8edffe7eb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 14 Nov 2024 15:29:47 +0100 Subject: [PATCH] CMake: Fix install location of dSYM bundle for Qt apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously we used the TARGET_FILE genex as the destination where to place the extracted dSYM bundle of an app in the build folder. For Qt apps that have the MACOSX_BUNDLE property set, this is incorrect, because it placed the dSYM bundle inside the app bundle. We then manually install the dSYM bundle to the correct location. Because the build folder app bundle still contains the dSYM bundle, and CMake copies the entire app bundle dir when installing the app, this resulted in installing the dSYM bundle twice. Aside from waste of space, this is also against the Apple guidelines, and leads to certain issues with code-signing. Check the MACOSX_BUNDLE property to determine if the executable is a bundle, in which case treat it the same way we treat framework bundles, by placing the dSYM bundle next to the app bundle. Pick-to: 6.8 Change-Id: I7fb8fe49e0b26d0df8a32fc82530bbee32b51382 Reviewed-by: Tor Arne Vestbø --- cmake/QtSeparateDebugInfo.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/QtSeparateDebugInfo.cmake b/cmake/QtSeparateDebugInfo.cmake index dff64937f17..77d3a428252 100644 --- a/cmake/QtSeparateDebugInfo.cmake +++ b/cmake/QtSeparateDebugInfo.cmake @@ -286,9 +286,11 @@ function(qt_enable_separate_debug_info target installDestination) set(BUNDLE_ID ${target}) endif() + get_target_property(is_bundle ${target} MACOSX_BUNDLE) + if (NOT "x${arg_DSYM_OUTPUT_DIR}" STREQUAL "x") set(debug_info_bundle_dir "${arg_DSYM_OUTPUT_DIR}/${target}") - elseif(is_framework) + elseif(is_framework OR is_bundle) set(debug_info_bundle_dir "$") else() set(debug_info_bundle_dir "$")