Xcode Entitlements don't appear enabled with CMake

2.2k views Asked by At

I'm generating an Xcode iOS project from CMake, and am connecting the entitlements file like so:

set_target_properties(TargetApp PROPERTIES
    XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
    "${CMAKE_CURRENT_LIST_DIR}/TargetApp.entitlements")

And this is working well during compiling/signing/running, however the Xcode IDE does not seem to be able to see the things enabled (at least from the GUI point of view)

TargetApp.entitlements:

<?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.application-groups</key>
    <array>
        <string>REDACTED</string>
    </array>
    <key>inter-app-audio</key>
    <true/>
</dict>
</plist>

but once I configure the Xcode project, they do not appear "turned on" Xcode showing entitlements turned off

Any ideas on how to get CMake to convince Xcode these entitlements exist?

1

There are 1 answers

0
yano On BEST ANSWER

For the record, this is only a GUI problem. CMake does not generate the project settings that cause this to work, but the compiler picks it up just fine.