Add CMAKE_SOVERSION variable as default value for the SOVERSION property of shared libraries
When packaging libraries for Debian, I often encounter situations where upstream does not care about the SOVERSION
and leaves it undefined. As distributions require proper ABI versioning, this usually means patching the upstream CMakeLists.txt
to add a set_target_properties()
call with an appropriate SOVERSION
.
If I could specify a default value with the cmake
invocation from the debian/rules
build script, it would simplify the packaging workflow a lot.
I propose the following semantics:
- If the variable
CMAKE_SOVERSION
is not defined, theSOVERSION
property will not be initialized by default for any target; this is the same behavior as exhibited by CMake right now. - If the variable
CMAKE_SOVERSION
is defined and aSHARED
library target is created, theSOVERSION
property is initialized with that value.