title: Find versions of libraries pulled into project via CMakeLists
body: <p>In my project, configured by CMake, I use several external libraries (here "A") (which again are linked to other libraries (here "B")). Now, after upgrading those secondary external libraries ("B"), sometimes I forget to upgrade the initial external libraries ("A"). This leads to errors/warnings during the configuration stage of the main project, such as </p>
  
  <pre><code>CMake Warning at CMakeLists.txt:416 (add_executable):
    Cannot generate a safe runtime search path for target TTM-equation because
    files in some directories may conflict with libraries in implicit
    directories:
  
      runtime library [libmkl_gnu_thread.so] in /opt/intel/mkl/lib/intel64 may be hidden by files in:
        /opt/intel/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64
      runtime library [libmkl_intel_lp64.so] in /opt/intel/mkl/lib/intel64 may be hidden by files in:
        /opt/intel/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64
      runtime library [libmkl_core.so] in /opt/intel/mkl/lib/intel64 may be hidden by files in:
        /opt/intel/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64
      runtime library [libmkl_intel_thread.so] in /opt/intel/mkl/lib/intel64 may be hidden by files in:
        /opt/intel/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64
  
    Some of these libraries may not be found correctly.
  </code></pre>
  
  <p>Here I have two different versions of the intel MKL libraries as secondary library, which are pulled in by different initial external libraries, and which collide.<br>
  In order to find the culprit for pulling in the "old" version of the MKL libraries, I usually have to go through all the linked libraries with <code>ldd</code>, and check which of them is pulling in which version of the MKL libraries. This works fine for only a few external libraries, but as soon as I have >5 external libraries, it gets annoying and time-consuming.<br>
  Thus, is there an easier way of detecting the problematic library "A", without having to loop over all the included libraries?</p>