Instead of directly using an imported location we use
the soname if possible and after that the location name
to find the library using the location directory as hint.
This allows us to use an soname, which may be different
and to the location name (and residing directory). This
allows to use system installed libraries which may be updated
but are compatible with the one used at built time
as long as the location and name in which they were found in
are the same.
Fixes #1141
Instead of directly using an imported location we use the soname if possible and after that the location name to find the library using the location directory as hint.
This allows us to use an soname, which may be different and to the location name (and residing directory). This allows to use system installed libraries which may be updated but are compatible with the one used at built time as long as the location and name in which they were found in are the same.