From 196267cb827c5c1d7a62413b73e38d1bf3f42dbd Mon Sep 17 00:00:00 2001 From: David Roman Date: Thu, 27 Feb 2025 16:32:14 +0100 Subject: [PATCH 1/2] cmake: use standard GNU install directories for docs --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc046e1848..7d148f9cbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1743,7 +1743,7 @@ foreach(readme ${readme-docs}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${readme} ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt) if(NOT ZMQ_BUILD_FRAMEWORK) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION share/zmq) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() endforeach() @@ -1751,7 +1751,7 @@ if(WITH_DOC) if(NOT ZMQ_BUILD_FRAMEWORK) install( FILES ${html-docs} - DESTINATION doc/zmq + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT RefGuide) endif() endif() From 5dc11bef7e65bc13e6714fbb7027961737b32e1b Mon Sep 17 00:00:00 2001 From: David Roman Date: Mon, 2 Feb 2026 10:58:04 +0100 Subject: [PATCH 2/2] cmake: set default visibility to "hidden" Currently autotools build uses -fvisibility=hidden, but cmake does not. This creates a huge ABI difference between the libzmq.so when compiled with cmake vs autotools. With this patch the difference between the exported functions is minimum. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d148f9cbc..be1acb42fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ else() cmake_minimum_required(VERSION 2.8.12...3.31) endif() +set(CMAKE_CXX_VISIBILITY_PRESET hidden) + project(ZeroMQ) include(CheckIncludeFiles)