I was wondering if there's any specific command that performs codesign for application bundle or even a single executable file in macOS. The only way I've found out so far is
using the generic add_custom_command but perhaps there's an ad-hoc directive in cmake for this purpose which is also cross-platform (which means that in windows it will call signtool and in macOS/iPhone it will call codesign)
add_custom_command(TARGET myTarget POST_BUILD COMMAND ${CODESIGN_COMMANDLINE})