From e2620b538b6b7383b1f9814ed54ebaac46de3b60 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 4 May 2022 15:59:24 +0200 Subject: [PATCH] CMake: Split some iOS handling code into separate functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pick-to: 6.2 6.3 Change-Id: I722194c11ce2588ada78597129b5a185f1e9fc69 Reviewed-by: Alexey Edelev Reviewed-by: Jörg Bornemann --- src/corelib/Qt6CoreMacros.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index d4e2814d8b4..3e040ff2bde 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -902,7 +902,7 @@ function(_qt_internal_set_placeholder_apple_bundle_version target) endif() endfunction() -function(_qt_internal_finalize_ios_app target) +function(_qt_internal_set_xcode_development_team_id target) # If user hasn't provided a development team id, try to find the first one specified # in the Xcode preferences. if(NOT CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM AND NOT QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID) @@ -913,7 +913,9 @@ function(_qt_internal_finalize_ios_app target) PROPERTIES XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${team_id}") endif() endif() +endfunction() +function(_qt_internal_set_xcode_bundle_identifier target) # If user hasn't provided a bundle identifier for the app, get a default identifier # using the default bundle prefix from Xcode preferences and add it to the generated # Info.plist file. @@ -925,17 +927,26 @@ function(_qt_internal_finalize_ios_app target) PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "${bundle_id}") endif() endif() +endfunction() +function(_qt_internal_set_xcode_product_bundle_identifier target) # Reuse the same bundle identifier for the Xcode property. if(NOT CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER AND NOT QT_NO_SET_XCODE_BUNDLE_IDENTIFIER) get_target_property(existing_id "${target}" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER) if(NOT existing_id) + _qt_internal_get_default_ios_bundle_identifier(bundle_id) set_target_properties("${target}" PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${bundle_id}") 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_handle_ios_launch_screen("${target}") _qt_internal_set_placeholder_apple_bundle_version("${target}")