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 <ralf.habacker@freenet.de>
This commit is contained in:
Simon McVittie 2015-02-20 23:10:52 +01:00 committed by Ralf Habacker
parent 6d9e1553c9
commit 7ec30ffa90

View file

@ -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})