summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/recorder/CMakeLists.txt
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2021-12-15 23:40:17 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-12-17 13:38:49 +0000
commitf127e9010f682db9b25743aa4b7b90fcdce7b189 (patch)
tree0393638a85de7e6388e03f4ca330446553224638 /examples/multimedia/video/recorder/CMakeLists.txt
parent0d11ed2f1bb39a0ffdf55beeabbbdc5bdd5ac357 (diff)
Multimedia examples: Add camera and audio input entitlements
Apple needs apps to specify proper entitlements in order to grant the executable permissions to use services like camera and microphone. The multimedia examples using microphone and camera were sometimes crashing because of missing entitlements. To fix, add an entitlement file to all examples using these services, and add a post-build command to codesign the executables with the specified entitlements. Task-number: QTBUG-98419 Change-Id: I6a578def1f6a41b4d106ee49c0c32fad304ef3cb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 767315b2049f0685f12de3418c658313851e8c0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/multimedia/video/recorder/CMakeLists.txt')
-rw-r--r--examples/multimedia/video/recorder/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/multimedia/video/recorder/CMakeLists.txt b/examples/multimedia/video/recorder/CMakeLists.txt
index e885d0abe..a0067cd11 100644
--- a/examples/multimedia/video/recorder/CMakeLists.txt
+++ b/examples/multimedia/video/recorder/CMakeLists.txt
@@ -31,4 +31,15 @@ target_link_libraries(recorder
set_target_properties(recorder PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
+ XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
+ "${CMAKE_CURRENT_LIST_DIR}/recorder.entitlements"
)
+
+if(APPLE AND NOT IOS)
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ add_custom_command(TARGET recorder
+ POST_BUILD
+ COMMAND codesign --sign - --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/recorder.entitlements ${CMAKE_CURRENT_BINARY_DIR}/recorder.app
+ )
+ endif()
+endif()