Another alternative, if you are working with the Appstore, needs "rights" and, as such, should be associated with the Apple-Framework.
In the "Access rights to work" section (for example, GameCenter), you must have "Link Binary with Libraries" -buildstep, and then a link to "GameKit.framework". CMake "embeds" libraries "at a low level" in the command line, so Xcode really does not know about it, and therefore you cannot enable GameKit on the Capabilities screen.
One way to use CMake and "Link with Binaries" -buildstep is to generate xcodeproj using CMake, then use "sed" to "find and replace" and add GameKit the way Xcode likes it ..
The script looks like this (for Xcode 6.3.1).
s#\/\* Begin PBXBuildFile section \*\/#\/\* Begin PBXBuildFile section \*\/\ 26B12AA11C10544700A9A2BA \/\* GameKit.framework in Frameworks \*\/ = {isa = PBXBuildFile; fileRef = 26B12AA01C10544700A9A2BA \/\* GameKit.framework xxx\*\/; };#g s#\/\* Begin PBXFileReference section \*\/#\/\* Begin PBXFileReference section \*\/\ 26B12AA01C10544700A9A2BA \/\* GameKit.framework xxx\*\/ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System\/Library\/Frameworks\/GameKit.framework; sourceTree = SDKROOT; };#g s#\/\* End PBXFileReference section \*\/#\/\* End PBXFileReference section \*\/\ \ \/\* Begin PBXFrameworksBuildPhase section \*\/\ 26B12A9F1C10543B00A9A2BA \/\* Frameworks \*\/ = {\ isa = PBXFrameworksBuildPhase;\ buildActionMask = 2147483647;\ files = (\ 26B12AA11C10544700A9A2BA \/\* GameKit.framework in Frameworks xxx\*\/,\ );\ runOnlyForDeploymentPostprocessing = 0;\ };\ \/\* End PBXFrameworksBuildPhase section \*\/\ #g s#\/\* CMake PostBuild Rules \*\/,#\/\* CMake PostBuild Rules \*\/,\ 26B12A9F1C10543B00A9A2BA \/\* Frameworks xxx\*\/,#g s#\/\* Products \*\/,#\/\* Products \*\/,\ 26B12AA01C10544700A9A2BA \/\* GameKit.framework xxx\*\/,#g
save this in "gamecenter.sed" and then apply it like this (it will change your xcodeproj!)
sed -i.pbxprojbak -f gamecenter.sed myproject.xcodeproj/project.pbxproj
You may need to modify the script commands to suit your needs.
Warning: it may break with another version of Xcode, because the project format may change, the unique number (hardcoded) may not be unique - and, as a rule, other people's decisions are better - so if you donβt need support for Appstore + Ent Rightsments (and automatic assemblies), do not do this.
This is a CMake error, see http://cmake.org/Bug/view.php?id=14185 and http://gitlab.kitware.com/cmake/cmake/issues/14185