From 7ec30ffa907465698798bb38391d65bab91335bb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 20 Feb 2015 23:10:52 +0100 Subject: 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 --- cmake/dbus/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmake') diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt index 7c6b1ee9..f7bf4761 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}) -- cgit v1.2.3