Code signing for macOS
For a lot of use cases, creating unsigned apps or frameworks might be enough; however, if applications are to be distributed through the official channels for macOS, signing is a must. Signing works through Xcode itself; however, it is also possible to use CMake for signing.
To sign, there are three pieces of information needed: the ID of the bundle or framework, the development team ID, and the code signing entity. Values can be set with the XCODE_ATTRIBUTE_DEVELOPMENT_TEAM
and XCODE_ATTRIBUTE_CODE_SIGN_ENTITY
Xcode attributes. Typically, these are set on a project level and not for individual targets:
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development" CACHE STRING "") set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "12345ABC" CACHE STRING "")
The signing identity denotes the certificate provider and can usually be left as "Apple Development"
, which causes Xcode to select the appropriate signing...