From f4d847e44cc8710d94a3ac6f8b61e390f3a9aa55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Fri, 29 Nov 2019 20:45:44 +0100 Subject: [PATCH] CMakeLists: Export the library so-name and the version properly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures we have the same behaviour as building with Autotools. Signed-off-by: Björn Esser --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b70ad1e..c5b86e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,6 +258,13 @@ add_library(${PROJECT_NAME} ${JSON_C_HEADERS} ) +# Set the SO-VERSION and the build version for the built version. +set_target_properties(${PROJECT_NAME} + PROPERTIES + SOVERSION "5.0.0" + VERSION "${PROJECT_VERSION}" +) + # If json-c is used as subroject it set to target correct interface -I flags and allow # to build external target without extra include_directories(...) target_include_directories(${PROJECT_NAME}