Previously the SOVERSION was the year which indicated a stable ABI
within each year. It is highly unlikely that or ABI is that
stable. Hence we stop pretending that it is and change the version
with every release.
Gbp-Pq: Name 0006-Make-SOVERSION-change-with-every-release.patch
add_definitions is deprecated.
Note the new command does not need the -D qualifier but will detect
if there is one and act accordingly. This helps with package
configuration files that have "-DVAR" in their COMPILE_DEFINTIONS
As some packages actually already add the -D qualifier we now detect
that to be able to support old CMake version without
add_compile_definitions. In this case we prevent adding another -D
and use add_definitions.
Previously, this failed if one dependency was a static library compiled
without -fPIC. This is is the case for library libsuitesparseconfig on
Debian which has no dynamic alternative. The error messages read e.g.
```
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libsuitesparseconfig.a(SuiteSparse_config.o): relocation R_X86_64_PC32 against undefined symbol `malloc@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
```
With this patch we change the target_link_libraries call when using
BUILD_SHARED_LIBS=ON. We only pass the dynamic libraries as PUBLIC such
that they will get linked to the library. The static ones are passed as
INTERFACE libraries. This means that they will be automatically linked
to executables which link to the main library. Currently this transitive
linking will only work in the same module as we do not correctly export
libraries. But our build system explicitly links the others ones anyway.