From ba6389291fa16d911a887da08383e5ed75e9fdb5 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 5 Nov 2016 00:50:51 +0700 Subject: [PATCH] CMake: Set library version --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1d54cc..3d83a03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,11 @@ endif() install(TARGETS ${CJSON_LIB} DESTINATION lib${LIB_SUFFIX}) install(FILES cJSON.h DESTINATION include/cjson) +set_target_properties(${CJSON_LIB} + PROPERTIES + SOVERSION ${CJSON_VERSION_SO} + VERSION ${CJSON_VERSION}) + #cJSON_Utils set(PROJ_CJSON_UTILS cJSON_utils) set(CJSON_UTILS_LIB cjson_utils) @@ -36,6 +41,11 @@ target_link_libraries(${CJSON_UTILS_LIB} ${CJSON_LIB}) install(TARGETS ${CJSON_UTILS_LIB} DESTINATION lib${LIB_SUFFIX}) install(FILES cJSON_Utils.h DESTINATION include/cjson) +set_target_properties(${CJSON_UTILS_LIB} + PROPERTIES + SOVERSION ${CJSON_VERSION_SO} + VERSION ${CJSON_VERSION}) + option(ENABLE_CJSON_TEST "Enable building cJSON test" OFF) if(ENABLE_CJSON_TEST) set(TEST_CJSON cJSON_test)