Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit aac6c68

Browse files
committed
Implement basic library versioning for shared library builds
1 parent 976aaee commit aac6c68

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 2.8.4)
22
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
33
project(signal-protocol-c)
44

5+
SET(SIGNAL_PROTOCOL_C_VERSION_MAJOR 2)
6+
SET(SIGNAL_PROTOCOL_C_VERSION_MINOR 3)
7+
SET(SIGNAL_PROTOCOL_C_VERSION_PATCH 1)
8+
SET(SIGNAL_PROTOCOL_C_VERSION ${SIGNAL_PROTOCOL_C_VERSION_MAJOR}.${SIGNAL_PROTOCOL_C_VERSION_MINOR}.${SIGNAL_PROTOCOL_C_VERSION_PATCH})
9+
510
SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
611
SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Directory where lib will install")
712
SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ add_library(signal-protocol-c
7373

7474
if(BUILD_SHARED_LIBS)
7575
target_link_libraries(signal-protocol-c ${M_LIB})
76+
set_target_properties(signal-protocol-c PROPERTIES
77+
VERSION ${SIGNAL_PROTOCOL_C_VERSION}
78+
SOVERSION ${SIGNAL_PROTOCOL_C_VERSION_MAJOR}
79+
)
7680
endif()
7781

7882
INSTALL(

0 commit comments

Comments
 (0)