From e18dfefb5d39ae72f8ef18b13d22eb895e13bc0a Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 20 Feb 2015 23:10:52 +0100 Subject: [PATCH] Add versioned symbol support to cmake build system for linux platforms to keep in sync with autotools. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115 --- cmake/dbus/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt index 72f6f0d..c3b5878 100644 --- a/cmake/dbus/CMakeLists.txt +++ b/cmake/dbus/CMakeLists.txt @@ -285,6 +285,13 @@ else(WIN32) target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT} rt) endif(WIN32) +# Assume that Linux has -Wl,--version-script and other platforms do not +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(SOVERSION ${DBUS_LIBRARY_MAJOR}) + configure_file(${DBUS_DIR}/Version.in ${CMAKE_CURRENT_BINARY_DIR}/Version) + set_target_properties(dbus-1 PROPERTIES LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/Version) +endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + install(TARGETS dbus-1 ${INSTALL_TARGETS_DEFAULT_ARGS}) install_files(/include/dbus FILES ${dbusinclude_HEADERS}) -- 1.8.4.5