From 42990830c3d845458483f31ba36c2fa59d0e3f9f Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Fri, 24 Mar 2023 13:57:14 +0200 Subject: Fix .plist when building an example for iOS with CMake When building an example for iOS with qmake (qt-cmake -GXcode) the local Info.plists of three of the examples don't work, because they were using qmake substitutions (${EXECUTABLE_NAME} instead of ${MACOSX_BUNDLE_EXECUTABLE_NAME}), which resulted in "CFBundleExecutable is not specified". Instead use shared plist files, each for CMake and qmake. One of the removed files contained NSBluetoothPeripheralUsageDescription key, which I think can be discarded now; it is intended for iOS < 13, and the minimum for Qt 6 is 13. Change-Id: I901dc176c001e25ce88d42b9456b6e16d8f43c20 Reviewed-by: Qt CI Bot Reviewed-by: Timur Pocheptsov (cherry picked from commit 0d1db5eabc9df56c92b1ef836060bf5232524e9e) Reviewed-by: Qt Cherry-pick Bot --- examples/bluetooth/heartrate-game/CMakeLists.txt | 6 +-- examples/bluetooth/heartrate-game/Info.plist | 43 ---------------------- .../bluetooth/heartrate-game/heartrate-game.pro | 2 +- examples/bluetooth/heartrate-server/CMakeLists.txt | 6 +-- examples/bluetooth/heartrate-server/Info.plist | 43 ---------------------- .../heartrate-server/heartrate-server.pro | 2 +- examples/bluetooth/lowenergyscanner/CMakeLists.txt | 6 +-- examples/bluetooth/lowenergyscanner/Info.plist | 39 -------------------- .../lowenergyscanner/lowenergyscanner.pro | 2 +- examples/bluetooth/shared/Info.cmake.ios.plist | 39 ++++++++++++++++++++ examples/bluetooth/shared/Info.qmake.ios.plist | 39 ++++++++++++++++++++ 11 files changed, 90 insertions(+), 137 deletions(-) delete mode 100644 examples/bluetooth/heartrate-game/Info.plist delete mode 100644 examples/bluetooth/heartrate-server/Info.plist delete mode 100644 examples/bluetooth/lowenergyscanner/Info.plist create mode 100644 examples/bluetooth/shared/Info.cmake.ios.plist create mode 100644 examples/bluetooth/shared/Info.qmake.ios.plist diff --git a/examples/bluetooth/heartrate-game/CMakeLists.txt b/examples/bluetooth/heartrate-game/CMakeLists.txt index ac680cc2..e8507858 100644 --- a/examples/bluetooth/heartrate-game/CMakeLists.txt +++ b/examples/bluetooth/heartrate-game/CMakeLists.txt @@ -66,13 +66,13 @@ qt_add_qml_module(heartrate-game ) if (APPLE) + # Using absolute path for shared plist files is a Ninja bug workaround + get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE) if (IOS) set_target_properties(heartrate-game PROPERTIES - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" + MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.ios.plist" ) else() - # Using absolute path for shared plist files is a Ninja bug workaround - get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE) set_target_properties(heartrate-game PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.macos.plist" ) diff --git a/examples/bluetooth/heartrate-game/Info.plist b/examples/bluetooth/heartrate-game/Info.plist deleted file mode 100644 index d3c8c281..00000000 --- a/examples/bluetooth/heartrate-game/Info.plist +++ /dev/null @@ -1,43 +0,0 @@ - - - - - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - ${ASSETCATALOG_COMPILER_APPICON_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${QMAKE_SHORT_VERSION} - CFBundleSignature - ${QMAKE_PKGINFO_TYPEINFO} - CFBundleVersion - ${QMAKE_FULL_VERSION} - LSRequiresIPhoneOS - - MinimumOSVersion - ${IPHONEOS_DEPLOYMENT_TARGET} - NOTE - This file was generated by Qt/QMake. - NSBluetoothAlwaysUsageDescription - Qt's Heartrate-game needs Bluetooth LE - NSBluetoothPeripheralUsageDescription - Qt's Heartrate-game needs Bluetooth LE - UILaunchStoryboardName - LaunchScreen - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/bluetooth/heartrate-game/heartrate-game.pro b/examples/bluetooth/heartrate-game/heartrate-game.pro index 65be3382..417f77f3 100644 --- a/examples/bluetooth/heartrate-game/heartrate-game.pro +++ b/examples/bluetooth/heartrate-game/heartrate-game.pro @@ -45,7 +45,7 @@ qml_resources.prefix = /qt/qml/HeartRateGame RESOURCES = qml_resources -ios: QMAKE_INFO_PLIST = Info.plist +ios: QMAKE_INFO_PLIST = ../shared/Info.qmake.ios.plist macos: QMAKE_INFO_PLIST = ../shared/Info.qmake.macos.plist target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/heartrate-game diff --git a/examples/bluetooth/heartrate-server/CMakeLists.txt b/examples/bluetooth/heartrate-server/CMakeLists.txt index b1fa569d..0faca6d8 100644 --- a/examples/bluetooth/heartrate-server/CMakeLists.txt +++ b/examples/bluetooth/heartrate-server/CMakeLists.txt @@ -38,13 +38,13 @@ if(ANDROID OR APPLE) endif() if (APPLE) + # Using absolute path for shared plist files is a Ninja bug workaround + get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE) if (IOS) set_target_properties(heartrate-server PROPERTIES - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" + MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.ios.plist" ) else() - # Using absolute path for shared plist files is a Ninja bug workaround - get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE) set_target_properties(heartrate-server PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.macos.plist" ) diff --git a/examples/bluetooth/heartrate-server/Info.plist b/examples/bluetooth/heartrate-server/Info.plist deleted file mode 100644 index b50431e8..00000000 --- a/examples/bluetooth/heartrate-server/Info.plist +++ /dev/null @@ -1,43 +0,0 @@ - - - - - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - ${ASSETCATALOG_COMPILER_APPICON_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${QMAKE_SHORT_VERSION} - CFBundleSignature - ${QMAKE_PKGINFO_TYPEINFO} - CFBundleVersion - ${QMAKE_FULL_VERSION} - LSRequiresIPhoneOS - - MinimumOSVersion - ${IPHONEOS_DEPLOYMENT_TARGET} - NOTE - This file was generated by Qt/QMake. - NSBluetoothAlwaysUsageDescription - This is Qt's Heartrate server example, it needs your Bluetooth radio! - NSBluetoothPeripheralUsageDescription - Well, this is Qt's Heartrate server, it needs your Bluetooth radio if you don't mind! - UILaunchStoryboardName - LaunchScreen - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/bluetooth/heartrate-server/heartrate-server.pro b/examples/bluetooth/heartrate-server/heartrate-server.pro index 800f3f16..56869fd7 100644 --- a/examples/bluetooth/heartrate-server/heartrate-server.pro +++ b/examples/bluetooth/heartrate-server/heartrate-server.pro @@ -8,7 +8,7 @@ CONFIG += console SOURCES += main.cpp -ios: QMAKE_INFO_PLIST = Info.plist +ios: QMAKE_INFO_PLIST = ../shared/Info.qmake.ios.plist macos: QMAKE_INFO_PLIST = ../shared/Info.qmake.macos.plist target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/heartrate-server diff --git a/examples/bluetooth/lowenergyscanner/CMakeLists.txt b/examples/bluetooth/lowenergyscanner/CMakeLists.txt index 6f5f5692..252a6818 100644 --- a/examples/bluetooth/lowenergyscanner/CMakeLists.txt +++ b/examples/bluetooth/lowenergyscanner/CMakeLists.txt @@ -31,13 +31,13 @@ target_link_libraries(lowenergyscanner PUBLIC ) if (APPLE) + # Using absolute path for shared plist files is a Ninja bug workaround + get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE) if (IOS) set_target_properties(lowenergyscanner PROPERTIES - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" + MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.ios.plist" ) else() - # Using absolute path for shared plist files is a Ninja bug workaround - get_filename_component(SHARED_PLIST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../shared ABSOLUTE) set_target_properties(lowenergyscanner PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.macos.plist" ) diff --git a/examples/bluetooth/lowenergyscanner/Info.plist b/examples/bluetooth/lowenergyscanner/Info.plist deleted file mode 100644 index 7f056858..00000000 --- a/examples/bluetooth/lowenergyscanner/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - ${ASSETCATALOG_COMPILER_APPICON_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${QMAKE_SHORT_VERSION} - CFBundleSignature - ${QMAKE_PKGINFO_TYPEINFO} - CFBundleVersion - ${QMAKE_FULL_VERSION} - LSRequiresIPhoneOS - - MinimumOSVersion - ${IPHONEOS_DEPLOYMENT_TARGET} - NSBluetoothAlwaysUsageDescription - Qt LE scanner wants to access your Bluetooth adapter - UILaunchStoryboardName - LaunchScreen - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/bluetooth/lowenergyscanner/lowenergyscanner.pro b/examples/bluetooth/lowenergyscanner/lowenergyscanner.pro index 54ba3dce..de21265d 100644 --- a/examples/bluetooth/lowenergyscanner/lowenergyscanner.pro +++ b/examples/bluetooth/lowenergyscanner/lowenergyscanner.pro @@ -38,7 +38,7 @@ qml_resources.prefix = /qt/qml/Scanner RESOURCES = qml_resources -ios: QMAKE_INFO_PLIST = Info.plist +ios: QMAKE_INFO_PLIST = ../shared/Info.qmake.ios.plist macos: QMAKE_INFO_PLIST = ../shared/Info.qmake.macos.plist target.path = $$[QT_INSTALL_EXAMPLES]/bluetooth/lowenergyscanner diff --git a/examples/bluetooth/shared/Info.cmake.ios.plist b/examples/bluetooth/shared/Info.cmake.ios.plist new file mode 100644 index 00000000..be5a2bac --- /dev/null +++ b/examples/bluetooth/shared/Info.cmake.ios.plist @@ -0,0 +1,39 @@ + + + + + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleVersion + 0.0.1 + CFBundleShortVersionString + 0.0.1 + CFBundleGetInfoString + + NSHumanReadableCopyright + + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleDevelopmentRegion + English + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSBluetoothAlwaysUsageDescription + Qt BT Example wants to access your Bluetooth adapter + + diff --git a/examples/bluetooth/shared/Info.qmake.ios.plist b/examples/bluetooth/shared/Info.qmake.ios.plist new file mode 100644 index 00000000..1a3885b5 --- /dev/null +++ b/examples/bluetooth/shared/Info.qmake.ios.plist @@ -0,0 +1,39 @@ + + + + + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleVersion + 0.0.1 + CFBundleShortVersionString + 0.0.1 + CFBundleGetInfoString + + NSHumanReadableCopyright + + CFBundleIconFile + + CFBundleDevelopmentRegion + English + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSBluetoothAlwaysUsageDescription + Qt BT Example wants to access your Bluetooth adapter + + -- cgit v1.2.1