diff options
author | Juha Vuolle <juha.vuolle@qt.io> | 2023-02-12 19:43:12 +0200 |
---|---|---|
committer | Juha Vuolle <juha.vuolle@qt.io> | 2023-03-16 08:39:39 +0200 |
commit | 716d512d949efec9550dfcd360d530b36d39ebf5 (patch) | |
tree | c2b14617f6748b7609301293e977343eba70e764 /examples/positioning/satelliteinfo/CMakeLists.txt | |
parent | a7b347aa6d7ebdd3d7e63eb7b6ee827027b623a0 (diff) |
Adjust positioning examples to use new QPermission API
Now when the library itself does not request permissions, that needs
to be done on the user application level.
This patch updates all examples to query the required permissions.
As there is no QML API yet, the QML examples do it directly from
main.
Task-number: QTBUG-109963
Change-Id: I3910889b366fb72e995fff9225bc2559727ece2a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'examples/positioning/satelliteinfo/CMakeLists.txt')
-rw-r--r-- | examples/positioning/satelliteinfo/CMakeLists.txt | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/examples/positioning/satelliteinfo/CMakeLists.txt b/examples/positioning/satelliteinfo/CMakeLists.txt index d0eda156..77579a04 100644 --- a/examples/positioning/satelliteinfo/CMakeLists.txt +++ b/examples/positioning/satelliteinfo/CMakeLists.txt @@ -22,6 +22,7 @@ qt_add_executable(satelliteinfo set_target_properties(satelliteinfo PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.satelliteinfo" ) target_link_libraries(satelliteinfo PRIVATE @@ -38,12 +39,18 @@ if(ANROID AND TARGET Qt::SerialPort) target_link_libraries(satelliteinfo PRIVATE Qt::SerialPort) endif() -if (IOS) +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) - set_target_properties(satelliteinfo PROPERTIES - MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.ios.plist" - ) + if (IOS) + set_target_properties(satelliteinfo PROPERTIES + MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.ios.plist" + ) + else() + set_target_properties(satelliteinfo PROPERTIES + MACOSX_BUNDLE_INFO_PLIST "${SHARED_PLIST_DIR}/Info.cmake.macos.plist" + ) + endif() endif() qt_add_resources(satelliteinfo "resources" @@ -68,3 +75,9 @@ install(TARGETS satelliteinfo BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + +if(APPLE AND NOT CMAKE_GENERATOR STREQUAL "Xcode") + # Need to sign application for location permissions to work + add_custom_command(TARGET satelliteinfo + POST_BUILD COMMAND codesign -s - satelliteinfo.app) +endif() |