RPATH not set, but necessary

CMake doesn’t look at library IDs on macOS (as of now). In any case, @rpath/foo/bar/baz.dylib is possible (and done for frameworks), so a simple dirname isn’t the solution either. Other platforms don’t have this problem either by not having them (Windows) or library lookups being purely filename based (Linux and other ELF platforms) rather than supporting directory traversal like macOS does.