CPack Verbose: warning: embedded item does not exist

Hi, I’m creating a macOS app bundle using CPack with the BUNDLE generator. The resulting .app bundle and DMG installer work fine. However, during fixup_bundle, I see a lot of repeated warnings and the process itself takes very long:

CPack Verbose: fixup_bundle: preparing...
CPack Verbose: warning: embedded item does not exist '/opt/opt/libpng/lib/libpng16.16.dylib'
CPack Verbose: warning: embedded item does not exist '/opt/opt/libpng/lib/libpng16.16.dylib'

I’m on an Apple silicon machine and the mentioned libraries are available from brew in /opt/homebrew/opt/.... As mentioned, the libraries end up in the app bundle correctly. Can I resolve the warning and speed-up the fixup_bundle process?

fixup_bundle is very slow because it remembers nothing between library resolutions (i.e., if in one call it finds and fixes libfoo.dylib on another call it will do it again). It also doesn’t handle some corner cases in library resolution.

Alas, the replacement is not yet in CMake itself (file(GET_RUNTIME_DEPENDENCIES) is the first part). This script does everything in a much faster way but really needs to be adapted to a CMake API to do the other half of fixing library IDs and references (it also does file(GRD) itself)

Thanks for the python script! So, does it mean that the warnings can safely be ignored?

Honestly, I don’t know. If it works for something, I’d just accept it. When I went in there looking to properly implement more dyld support, it only made it even slower and even harder to follow.