soname
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Sun, 18 Dec 2016 11:58:14 +0000 (11:58 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 18 Dec 2016 11:58:14 +0000 (11:58 +0000)
Gbp-Pq: Name soname.patch

cmake/modules/DuneMacros.cmake

index b5a913effcaf6ca43e78beb3f79b58a9dd3e4ce6..c558daaa57eae763adbf9aa88bd9e6805a1ca55b 100644 (file)
@@ -1011,8 +1011,13 @@ endfunction(dune_expand_object_libraries)
 # More docu can be found at the top of this file.
 macro(dune_add_library basename)
   include(CMakeParseArguments)
-  cmake_parse_arguments(DUNE_LIB ";APPEND;NO_EXPORT;OBJECT" "COMPILE_FLAGS"
+  cmake_parse_arguments(DUNE_LIB ";APPEND;NO_EXPORT;OBJECT" "COMPILE_FLAGS;SOVERSION"
     "ADD_LIBS;SOURCES" ${ARGN})
+  if(NOT DUNE_LIB_SOVERSION)
+    # If no explicit version is given, we assume the ABI is not stable and
+    # changes with every release.
+    set(DUNE_LIB_SOVERSION ${ProjectVersion})
+  endif()
   if(DUNE_LIB_OBJECT)
     if(DUNE_LIB_${basename}_SOURCES)
       message(FATAL_ERROR "There is already a library with the name ${basename}, "
@@ -1055,6 +1060,7 @@ macro(dune_add_library basename)
     endif()
     # Build library in ${PROJECT_BINARY_DIR}/lib
     set_target_properties(${basename} PROPERTIES
+      SOVERSION ${DUNE_LIB_SOVERSION}
       LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
       ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
 
@@ -1081,6 +1087,7 @@ macro(dune_add_library basename)
         #create shared libs
         add_library(${basename}-shared SHARED  ${DUNE_LIB_SOURCES})
         set_target_properties(${basename}-shared PROPERTIES
+          SOVERSION ${DUNE_LIB_SOVERSION}
           OUTPUT_NAME ${basename}
           LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
         # link with specified libraries.