[CMake] Mac Xcode 11 Generator bug/problem with CODE_SIGN_IDENTITY default

Eric Wing ewmailing at gmail.com
Mon Oct 14 17:27:01 EDT 2019


I hit a problem with the CMake/Xcode Generator using Xcode 11. (I
think this problem started in Xcode 10 actually, but now I'm blocked
really hard and need to solve this.)


By default, Xcode is now trying to do "Sign to run locally" for the
Code Signing Identity (CODE_SIGN_IDENTITY) property, by default.



For trivial apps with no embedded libraries/frameworks, this seems to
get through. However, for my real, more complicated projects, I have
bundled libraries/frameworks. But since CMake doesn't really have full
support for Xcode signing, the embedded libraries/frameworks are not
signed, and the code sign process to local sign the .app fails.


So to workaround this, I would like to tell Xcode to disable code
signing entirely.

Unfortunately, the only way to disable this seems to be to set the
CODE_SIGN_IDENTITY to "", i.e. make the field completely blank. The
following link shows all the steps with pictures, but basically you
set the box to "Other" and then submit a completely blank input box.
This internally in the Xcode project sets CODE_SIGN_IDENTITY to "".

https://stackoverflow.com/a/54296008


But my problem in CMake is that when I try to set the Xcode property
to "", it ignores the setting and defer to Xcode's default value of
"Sign to run locally".

# This has no effect
set_property(TARGET ${my_app} PROPERTY XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")


How can I force this property to be overridden with ""?

Thanks,
Eric


More information about the CMake mailing list