Skip to content

Commit 90de683

Browse files
committed
Adjust versioning of shared libraries.
Simplify - just use the library versions for the shared library links. Also, accommodate OpenBSD's particular convention for such libraries.
1 parent b918921 commit 90de683

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ project(SC)
4242

4343
# SC version
4444
set(SC_VERSION_MAJOR 0)
45-
set(SC_VERSION_MINOR 8-dev)
46-
set(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
47-
48-
# SC ABI version. SC_ABI_SOVERSION should be incremented
49-
# for each release introducing API incompatibilities
50-
set(SC_ABI_SOVERSION 2)
51-
set(SC_ABI_VERSION ${SC_ABI_SOVERSION}.0.0)
45+
set(SC_VERSION_MINOR 9)
46+
set(SC_VERSION_PATCH 1)
47+
set(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH})
5248

5349
# Minimum required version of CMake
5450
cmake_minimum_required(VERSION 3.6.3)
@@ -65,6 +61,12 @@ else(NOT SC_IS_SUBBUILD)
6561
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SC_CMAKE_DIR}")
6662
endif(NOT SC_IS_SUBBUILD)
6763

64+
# OpenBSD has its own naming conventions. Set a platform variable based on
65+
# the OS name so we can test for it succinctly.
66+
if ("${CMAKE_SYSTEM}" MATCHES ".*OpenBSD.*")
67+
set(OPENBSD ON)
68+
endif ("${CMAKE_SYSTEM}" MATCHES ".*OpenBSD.*")
69+
6870
# testing and compilation options, build output dirs, install dirs, uninstall, package creation, etc
6971
include(${SC_CMAKE_DIR}/SC_Build_opts.cmake)
7072

cmake/SC_Targets.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ macro(SC_ADDLIB _addlib_target)
4646

4747
if(${_arg_prefix}_SHARED)
4848
add_library(${_addlib_target} SHARED ${${_arg_prefix}_SOURCES})
49-
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_ABI_VERSION} SOVERSION ${SC_ABI_SOVERSION})
49+
if(OPENBSD)
50+
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
51+
else(OPENBSD)
52+
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_VERSION} SOVERSION ${SC_VERSION_MAJOR})
53+
endif(OPENBSD)
5054
if(APPLE)
5155
set_target_properties(${_addlib_target} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
5256
endif(APPLE)

0 commit comments

Comments
 (0)