From: Simon McVittie Date: Fri, 20 Feb 2015 22:10:52 +0000 (+0100) Subject: Add versioned symbol support to cmake build system for linux platforms to keep in... X-Git-Tag: dbus-1.9.14~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ec30ffa907465698798bb38391d65bab91335bb;p=thirdparty%2Fdbus.git 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 Reviewed-by: Ralf Habacker --- diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt index 7c6b1ee99..f7bf47612 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})