GET_RUNTIME_DEPENDENCIES picks up incorrect versions of shared objects (e.g. 32 bit for a 64 bit build)
See this discussion for more detailed information. Essentially, when running
file(GET_RUNTIME_DEPENDENCIES ...) the results will include 32 bit libraries if they are installed on the system, even though when using ldd the correct libraries are 64 bit.
For example, on system 1:
$ ldconfig -N -p -X | grep -i z ... libz.so.1 (libc6,x86-64) => /lib64/libz.so.1 libz.so.1 (libc6) => /lib/libz.so.1 libz.so (libc6,x86-64) => /lib64/libz.so libz.so (libc6) => /lib/libz.so
on system 2:
$ ldconfig -N -p -X | grep -i z ... libz.so.1 (libc6,x86-64) => /lib64/libz.so.1 libz.so (libc6,x86-64) => /lib64/libz.so
On system 2 the resolved dependency given by cmake is:
/lib64/libz.so.1, but on system 1 it is:
however, for both systems, the output of ldd on my executable is
libz.so.1 => /lib64/libz.so.1.
libz is just an example, this occurs for many different libraries. This makes GET_RUNTIME_DEPENDENCIES unusable.