From adeb6090a0eb0cc5568d64a362382b138aba3383 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 2 Jun 2025 12:29:06 +0200 Subject: [PATCH] CMake: Fix location of iOS framework prl files iOS prl files for static frameworks were previously placed at a path like 6.8.3/ios/lib/QtCore.framework/Versions/A/Resources/QtCore.prl This caused qmake to silently fail to find iOS framework prl files. The failure could only be seen when calling qmake with -d -d: DEBUG 2: QMakeMetaInfo: Cannot find info file for 6.8.3/ios/lib/QtCore.framework/Resources/QtCore.prl This in turn can lead to various build failures if a different non-iOS prl file is found in a system path. Place the prl file into the root of each framework, e.g. at 6.8.3/ios/lib/QtCore.framework/QtCore.prl We didn't have this issue in 6.7 and earlier, because by default iOS was built with static libraries rather than static frameworks. Amends 291817b0bf3f351843b0c1d0de237dc8df5c0fa5 Pick-to: 6.8 Fixes: QTBUG-137297 Change-Id: Idff8e808e9bfc009f82d2a59e5e6752ed8a55714 Reviewed-by: Joerg Bornemann (cherry picked from commit 89e7facc2e3095684e64f16103cfce017235e504) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit d12cdac9bd2e7694da598f20ebf566a439f1aaaa) --- cmake/QtPrlHelpers.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/QtPrlHelpers.cmake b/cmake/QtPrlHelpers.cmake index 45bfaedcdf6..bc76a472e27 100644 --- a/cmake/QtPrlHelpers.cmake +++ b/cmake/QtPrlHelpers.cmake @@ -65,9 +65,17 @@ function(qt_generate_prl_file target install_dir) set(prefix_for_final_prl_name "$") endif() - # For frameworks, the prl file should be placed under the Resources subdir. + # For macOS frameworks, the prl file should be placed under the Resources subdir. + # For iOS, visionOS, watchOS, tvOS, there is no Resources subdir, and the contents needs to + # be placed directly in the framework root, as described at + # https://developer.apple.com/documentation/bundleresources/placing-content-in-a-bundle?language=objc get_target_property(is_framework ${target} FRAMEWORK) - if(is_framework) + if(APPLE AND (NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")) + set(is_macos TRUE) + else() + set(is_macos FALSE) + endif() + if(is_framework AND is_macos) get_target_property(fw_version ${target} FRAMEWORK_VERSION) string(APPEND prefix_for_final_prl_name "Versions/${fw_version}/Resources/") endif()