No need to define DYLD_LIBRARY_PATH for MacOS. It is ignored most of the time.
The fact that is suppressed depending the way you start the program makes it very unreliable. It is recommended to rely on RPATH. The LD_LIBRARY_PATH is still used by dlopen() to locate the library to be loaded dynamically.