I am creating a plugin application (dylib) that depends on several other libraries. These other libraries are installed on my system, but are not guaranteed to be installed on any user's system. So I need to find a way bundle the dependencies along with my application.
I found that I can use otool
to list or change the paths to other dylibs. This would allow to create a folder that bundles my plugin application and all needed dependencies.
However, doing this manually seems like a time-consuming and dumb task. Are there utilities available to automate it?
Or perhaps I'm doing it wrong and there is a better and more obvious approach for this problem?
Edit I created a script that automates most the task.