We are doing this to strip our plugin binaries. It works. But is there a better way - it seems a little fragile, certainly isn’t DRY and is the wrong side of the initial code signing. The linker flag seems to no longer work (-s apparently deprecated with no useful information on what replaces it from Apple!).
Any tips appreciated, I’m a CMAKE amateur
# release build only on the mac strip the binaries
if(NOT MSVC AND ${CMAKE_BUILD_TYPE} STREQUAL "Release")
add_custom_command(TARGET ${PROJECT_NAME}_VST3 POST_BUILD
COMMAND strip -no_code_signature_warning -x $<TARGET_FILE:${PROJECT_NAME}_VST3>
)
add_custom_command(TARGET ${PROJECT_NAME}_AU POST_BUILD
COMMAND strip -no_code_signature_warning -x $<TARGET_FILE:${PROJECT_NAME}_AU>
)
add_custom_command(TARGET ${PROJECT_NAME}_VST POST_BUILD
COMMAND strip -no_code_signature_warning -x $<TARGET_FILE:${PROJECT_NAME}_VST>
)
add_custom_command(TARGET ${PROJECT_NAME}_AAX POST_BUILD
COMMAND strip -no_code_signature_warning -x $<TARGET_FILE:${PROJECT_NAME}_AAX>
)
endif()
If you’re using the Xcode generator, then maybe XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING and XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT are worth investigating. For Ninja/Make, CMake creates install/strip targets.
I gave up trying to use cmake for the entire build & package, especially all the stripping and notarizing stuff…life’s too short. I ended up using a shell script for the overall build, and just use cmake to essentially replace Projucer.
If you’ve got a shell script working, it’s fairly straightforward to translate each command into a CMake post-build step. You could even have a post-build step that just executes your shell script
I’ve got it all figured in CMAKE now. The code above (Jan 15 post) was working but you have to delay the plugin copy step, which is documented in the cmake JUCE readme.