Commit 0bc32b58 authored by Dominik Charousset's avatar Dominik Charousset

Fix library version of shared objects

parent d6e0c75f
......@@ -162,6 +162,28 @@ endif()
find_package(CAF COMPONENTS core io test)
# -- fetch CAF version ---------------------------------------------------------
# read content of config.hpp
file(READ "${CAF_INCLUDE_DIR_CORE}/caf/config.hpp" CONFIG_HPP)
# get line containing the version
string(REGEX MATCH "#define CAF_VERSION [0-9]+" VERSION_LINE "${CONFIG_HPP}")
# extract version number from line
string(REGEX MATCH "[0-9]+" VERSION_INT "${VERSION_LINE}")
# calculate major, minor, and patch version
math(EXPR CAF_VERSION_MAJOR "${VERSION_INT} / 10000")
math(EXPR CAF_VERSION_MINOR "( ${VERSION_INT} / 100) % 100")
math(EXPR CAF_VERSION_PATCH "${VERSION_INT} % 100")
# create full version string
set(CAF_VERSION
"${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}.${CAF_VERSION_PATCH}")
# set the library version for our shared library targets
if(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
set(CAF_LIB_VERSION "${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}")
else()
set(CAF_LIB_VERSION "${CAF_VERSION}")
endif()
# -- compiler setup ------------------------------------------------------------
# Enable a ton of warnings if --more-clang-warnings is used.
......
cmake_minimum_required(VERSION 2.8.12)
project(caf_net C CXX)
# get header files; only needed by CMake generators,
# e.g., for creating proper Xcode projects
file(GLOB_RECURSE LIBCAF_NET_HDRS "caf/*.hpp")
......@@ -42,7 +39,7 @@ set(LIBCAF_NET_SRCS
src/stream_socket.cpp
src/udp_datagram_socket.cpp
src/defaults.cpp
src/message_queue.cpp
src/message_queue.cpp
src/worker.cpp
)
......@@ -60,7 +57,7 @@ if (NOT CAF_BUILD_STATIC_ONLY)
set_target_properties(libcaf_net_shared
PROPERTIES
SOVERSION ${CAF_VERSION}
VERSION ${CAF_VERSION}
VERSION ${CAF_LIB_VERSION}
OUTPUT_NAME caf_net
)
install(TARGETS libcaf_net_shared
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment