summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-07-14 00:36:32 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-10 09:41:25 +0000
commit07043f26120cc1f1a011082edb98e4da64ba305f (patch)
tree493c20c8281af0629d471bb4a6981d8ce2952d85
parentc8cdc3eb96494283d2f5027268e415b46f21a1de (diff)
downloadqtbase-07043f26120cc1f1a011082edb98e4da64ba305f.tar.gz
cmake: Work around bug in CMake's Xcode generator setting INSTALL_PATH
CMake will set the INSTALL_PATH for applications to an empty string, which confuses Xcode and results in application archives that can't be distributed on the App Store. https://gitlab.kitware.com/cmake/cmake/-/issues/15183 Change-Id: Ie19f41c20fdca1e98b368e3ce4cc524c8df0b23b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit fef9e0e216d07d7e8a144f57a8ec4133ff94fac7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/corelib/Qt6CoreMacros.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index cb7ddf8d81..f21ca81e3f 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1126,6 +1126,21 @@ function(_qt_internal_set_xcode_code_sign_style target)
endif()
endfunction()
+# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/15183
+function(_qt_internal_set_xcode_install_path target)
+ if(NOT CMAKE_XCODE_ATTRIBUTE_INSTALL_PATH
+ AND NOT QT_NO_SET_XCODE_INSTALL_PATH)
+ get_target_property(existing_install_path
+ "${target}" XCODE_ATTRIBUTE_INSTALL_PATH)
+ if(NOT existing_install_path)
+ set_target_properties("${target}"
+ PROPERTIES
+ XCODE_ATTRIBUTE_INSTALL_PATH
+ "$(inherited)")
+ endif()
+ endif()
+endfunction()
+
function(_qt_internal_set_xcode_bundle_display_name target)
# We want the value of CFBundleDisplayName to be ${PRODUCT_NAME}, but we can't put that
# into the Info.plist.in template file directly, because the implicit configure_file(Info.plist)
@@ -1200,6 +1215,7 @@ function(_qt_internal_finalize_ios_app target)
_qt_internal_set_xcode_code_sign_style("${target}")
_qt_internal_set_xcode_bundle_display_name("${target}")
_qt_internal_set_xcode_bitcode_enablement("${target}")
+ _qt_internal_set_xcode_install_path("${target}")
_qt_internal_handle_ios_launch_screen("${target}")
_qt_internal_set_placeholder_apple_bundle_version("${target}")
@@ -1220,6 +1236,8 @@ function(_qt_internal_finalize_macos_app target)
list(APPEND install_rpath "@executable_path/../Frameworks")
list(REMOVE_DUPLICATES install_rpath)
set_property(TARGET ${target} PROPERTY INSTALL_RPATH "${install_rpath}")
+
+ _qt_internal_set_xcode_install_path("${target}")
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)