From the Apple documentation:
Before you can use a dynamic library as a dependent library, the library and its header files must be installed on your computer.
The standard locations for header files are (not always needed):
The standard locations for dynamic libraries (dylib files) are:
You may also place the .dylib file at a nonstandard location in your file system, but you must add that location to one of these environment variables:
So in short, this is what I do when developing an application that needs a dylib:
1) For the development process, I copy the dylib file to ~/lib - This way my IDE (Lazarus Pascal) can find the dylib.
2) When testing for deployment, I remove the dylib from ~/lib, so I can test if I added the dylib correctly in the .app bundle.
Typically I create 2 scripts for that (MySQL client dylib example):
cp libmysqlclient.20.dylib ~/lib
ln -s libmysqlclient.20.dylib libmysqlclient.dylib
Don't forget to do
chmod +x install-dylib.sh
chmod +x uninstall-dylib.sh
Also note that in the install script, I do a symbolic link to a generic name (no version number).