cmake: add a possibility to set library version
authorPetr Štetiar <ynezz@true.cz>
Thu, 17 Feb 2022 12:04:45 +0000 (13:04 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 17 Feb 2022 12:26:44 +0000 (13:26 +0100)
Add a new `ABIVERSION` define which allows to control the SOVERSION used
for the built shared library. This is needed for downstream packaging to
properly track breaking ABI changes when updating to newer versions of
the library.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
CMakeLists.txt

index c98b12ac8d99353d4bf4e5c2e662343a8123f32a..f53e726aa8668cecfaa9a1d6dd81a792b00237cf 100644 (file)
@@ -48,3 +48,7 @@ INSTALL(FILES ustream-ssl.h
 INSTALL(TARGETS ustream-ssl
        LIBRARY DESTINATION lib
 )
+
+IF(ABIVERSION)
+       SET_TARGET_PROPERTIES(ustream-ssl PROPERTIES VERSION ${ABIVERSION})
+ENDIF()