I use CMake
add_custom_command(TARGET POST_BUILD COMMAND codesign ...)
for signing executable files on build.
It works fine, but when CPack generates package it rewrites rpath on executable files and call strip command on them. This changes the file and invalidates the signature. Is there any way in CMake to sign binary files after CPack finishes install and before actual packaging?