Content/Libraries
is not a standard directory within an app bundle; use Contents/Frameworks
instead (.dylib
s are allowed in that directory just the same as .framework
s).
Set the Install Name of each library to @rpath/libWhatever.dylib
and set the Runpath Search Path of the executable (in Contents/MacOS
) to @loader_path/../Frameworks
.
For library interdependencies then Runpath Search Path will need to be simply @loader_path
so dependent libraries can be loaded from the same directory.
EDIT: People might find the copy_dylibs.py
script in this repo useful for copying third-party .dylib
s into the App Bundle. It recursively hunts for libraries that need copying and corrects the Install Name of the libraries as well as code-signing them.