From abeaba15573c6fc7581699859fd9ff527d5a60c9 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Thu, 1 Dec 2016 22:33:43 +0000 Subject: [PATCH] Problem: CMake build uses library version as the ABI version Solution: set SOVERSION in CMakeLists to match the SONAME generated by libtool so that there is no mismatch between the output of the *NIX build systems. Before: $ ls -l total 2696 lrwxrwxrwx 1 luca luca 15 Dec 1 22:36 libzmq.so -> libzmq.so.4.2.0 lrwxrwxrwx 1 luca luca 15 Dec 1 22:36 libzmq.so.4.2.0 -> libzmq.so.4.2.1 -rwxr-xr-x 1 luca luca 906168 Dec 1 22:36 libzmq.so.4.2.1 $ readelf -d libzmq.so.4.2.1 | grep SONAME 0x000000000000000e (SONAME) Library soname: [libzmq.so.4.2.0] After: $ ls -l total 2700 lrwxrwxrwx 1 luca luca 15 Dec 1 22:31 libzmq.so -> libzmq.so.5.1.0 -rwxr-xr-x 1 luca luca 906168 Dec 1 22:31 libzmq.so.4.2.1 lrwxrwxrwx 1 luca luca 15 Dec 1 22:31 libzmq.so.5.1.0 -> libzmq.so.4.2.1 $ readelf -d libzmq.so.4.2.1 | grep SONAME 0x000000000000000e (SONAME) Library soname: [libzmq.so.5.1.0] --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80eb68f2..ed9ecfab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -733,11 +733,12 @@ if (MSVC) OUTPUT_NAME "libzmq-static") else () add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig}) + # NOTE: the SOVERSION MUST be the same as the one generated by libtool! set_target_properties (libzmq PROPERTIES COMPILE_DEFINITIONS "DLL_EXPORT" PUBLIC_HEADER "${public_headers}" VERSION ${ZMQ_VERSION} - SOVERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.0" + SOVERSION "5.1.0" OUTPUT_NAME "libzmq" PREFIX "") if (ZMQ_BUILD_FRAMEWORK)