MacOSX: added entitlements to access Documents and camera

This commit is contained in:
matlabbe
2025-10-12 13:30:16 -07:00
parent f54b7685f3
commit 739628aef9
3 changed files with 29 additions and 3 deletions

View File

@@ -77,6 +77,14 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
SET(qtconf_dest_dir Resources)
SET(thirdparty_dest_dir MacOS)
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
# Add the entitlement file to the target's properties
set(MACOS_ENTITLEMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/app.entitlements")
# Set the entitlement file for the target
set_target_properties(rtabmap_app PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${MACOS_ENTITLEMENTS_FILE}"
)
ENDIF(APPLE)
IF(OpenNI2_FOUND)

14
app/src/app.entitlements Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-only</key>
<false/>
<key>com.apple.security.device.camera</key>
<true/>
</dict>
</plist>s