[CMake] OSX Code Signing best practice

Harry Mallon Harry at codexdigital.com
Tue Jul 12 12:49:55 EDT 2016


Hello all,

What is the current best practice for code signing OSX .apps and binaries? I am using:

1. MAC_OSX_BUNDLE for my .app targets.
2. unix style executables
3. dylibs
4. A prefpane (which I haven't got working yet) using something like the below:

    add_library(prefpane MODULE
        ${sourceFiles}
    )

    set_target_properties(codexprefpane PROPERTIES
        BUNDLE YES
        BUNDLE_EXTENSION prefPane
        XCODE_ATTRIBUTE_WRAPPER_EXTENSION prefPane
        MACOSX_BUNDLE_INFO_PLIST ${prefpane_plist_file}
    )

I am not using the CPackBundle generator so I cannot use the signing in that. I have tried:

1. Using set_target_properties( .... "XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY" "${SIGN_ID}")
2. Using an add_custom_command step. This code signs before all the Resources are copied in so the signatures are invalid

Any ideas?
Harry

Harry Mallon
CODEX | Software Engineer
60 Poland Street | London | England | W1F 7NT
E harry at codexdigital.com | T +44 203 7000 989


More information about the CMake mailing list