summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-05-04 15:42:06 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-05-20 13:05:55 +0200
commit91743210003c8a9140d2ba8132b0506f3737e64e (patch)
treeb55cdac40ff5584ec12b06d961ac9cbc8a31f52f /src/corelib
parent8370427c43ee1a9e52cadd24fd67a7a18ef08230 (diff)
CMake: Set iOS default code style signing to Automatic
As far as I can see, the default is already 'Automatic' when it is not specified, but it does improve some xcodebuild error messages in certain edge cases if the option is specified explicitly. Note that setting the style to Automatic will not suffice in order to build the project from the command line with xcodebuild, if there is no existing provisioning profile for the project in ~/Library/MobileDevice/Provisioning Profiles You either need to build it once via the Xcode GUI, or you need to call xcodebuild -allowProvisioningUpdates which will try to create / download a provisioning profile from Apple's server. This implies that Xcode must have been launched at least once, and configured with a valid Apple developer account, including a free account. qmake already generates a Makefile that calls xcodebuild -allowProvisioningUpdates. CMake doesn't have a Makefile wrapper, so calling cmake --build . will call xcodebuild directly, which again means users need to pass -allowProvisioningUpdates explicitly. It does not look like CMake intends to call it automatically any time soon, see https://gitlab.kitware.com/cmake/cmake/-/issues/22615 We intend to teach Qt Creator to add the -allowProvisioningUpdate option when building a project using CMake. The code sign style will not be set if the target XCODE_ATTRIBUTE_CODE_SIGN_STYLE property or the CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE variable has a value. There's also an opt-out variable called QT_NO_SET_XCODE_CODE_SIGN_STYLE Pick-to: 6.2 6.3 Fixes: QTBUG-96347 Change-Id: If65ccb8a0393ff6d80e6caea3b8003fc59a8a62a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/Qt6CoreMacros.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 0e11592e28..84b17b24dc 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -958,11 +958,27 @@ function(_qt_internal_set_xcode_targeted_device_family target)
endif()
endfunction()
+function(_qt_internal_set_xcode_code_sign_style target)
+ if(NOT CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE
+ AND NOT QT_NO_SET_XCODE_CODE_SIGN_STYLE)
+ get_target_property(existing_code_style
+ "${target}" XCODE_ATTRIBUTE_CODE_SIGN_STYLE)
+ if(NOT existing_code_style)
+ set(existing_code_style "Automatic")
+ set_target_properties("${target}"
+ PROPERTIES
+ XCODE_ATTRIBUTE_CODE_SIGN_STYLE
+ "${existing_code_style}")
+ endif()
+ endif()
+endfunction()
+
function(_qt_internal_finalize_ios_app target)
_qt_internal_set_xcode_development_team_id("${target}")
_qt_internal_set_xcode_bundle_identifier("${target}")
_qt_internal_set_xcode_product_bundle_identifier("${target}")
_qt_internal_set_xcode_targeted_device_family("${target}")
+ _qt_internal_set_xcode_code_sign_style("${target}")
_qt_internal_handle_ios_launch_screen("${target}")
_qt_internal_set_placeholder_apple_bundle_version("${target}")