I made an application (an executable) calling some dylib successfully, However, the dylib files and the executable are in different directory. I added the directory contains
If the dylib is in the place specified by the INSTALL_NAME of the library, it will Just Work*.
Otherwise, you can add the location of the dylib to DYLD_LIBRARY_PATH. You might want to read the dyld documentation.
*) to be totally precise, it needs to be at DYLD_ROOT_PATH/INSTALL_NAME, but fussing with DYLD_ROOT_PATH is pretty rare.