CMake: Split some iOS handling code into separate functions

Change-Id: I722194c11ce2588ada78597129b5a185f1e9fc69
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e2620b538b6b7383b1f9814ed54ebaac46de3b60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2022-05-04 15:59:24 +02:00
parent a7027b8a43
commit 1caf31be3a

View File

@ -891,7 +891,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)
@ -902,7 +902,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.
@ -914,17 +916,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}")