cmake: add a possibility to set library version
authorPetr Štetiar <ynezz@true.cz>
Fri, 10 Jan 2020 21:00:04 +0000 (22:00 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 20 Jan 2020 15:54:10 +0000 (16:54 +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.

Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
CMakeLists.txt

index dcd455c..1a1b7d5 100644 (file)
@@ -92,3 +92,9 @@ IF(EXISTS ${json})
        )
 
 ENDIF()
+
+IF(ABIVERSION)
+       SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION ${ABIVERSION})
+       SET_TARGET_PROPERTIES(json_script PROPERTIES VERSION ${ABIVERSION})
+       SET_TARGET_PROPERTIES(blobmsg_json PROPERTIES VERSION ${ABIVERSION})
+ENDIF()