From 767315b2049f0685f12de3418c658313851e8c0f Mon Sep 17 00:00:00 2001 From: Doris Verria Date: Wed, 15 Dec 2021 23:40:17 +0100 Subject: 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 Pick-to: 6.3 6.2 Change-Id: I6a578def1f6a41b4d106ee49c0c32fad304ef3cb Reviewed-by: Alexandru Croitor --- examples/multimedia/declarative-camera/declarative-camera.pro | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'examples/multimedia/declarative-camera/declarative-camera.pro') diff --git a/examples/multimedia/declarative-camera/declarative-camera.pro b/examples/multimedia/declarative-camera/declarative-camera.pro index 2d6e2e759..58bb9d76c 100644 --- a/examples/multimedia/declarative-camera/declarative-camera.pro +++ b/examples/multimedia/declarative-camera/declarative-camera.pro @@ -9,3 +9,13 @@ RESOURCES += declarative-camera.qrc target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/declarative-camera INSTALLS += target include(../shared/shared.pri) + +macos { + macx-xcode { + code_sign_entitlements.name = CODE_SIGN_ENTITLEMENTS + code_sign_entitlements.value = $$PWD/$${TARGET}.entitlements + QMAKE_MAC_XCODE_SETTINGS += code_sign_entitlements + } else { + QMAKE_POST_LINK += "codesign --sign - --entitlements $$PWD/$${TARGET}.entitlements $${OUT_PWD}/$${TARGET}.app" + } +} -- cgit v1.2.3