Description: Patch to include the proper SONAME in the Orthanc Client library
Author: Sebastien Jodogne <s.jodogne@gmail.com>
Origin: upstream
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: Orthanc-0.6.2/CMakeLists.txt
===================================================================
--- Orthanc-0.6.2.orig/CMakeLists.txt	2013-10-04 16:33:53.000000000 +0200
+++ Orthanc-0.6.2/CMakeLists.txt	2013-10-07 12:43:30.879856165 +0200
@@ -3,9 +3,7 @@
 project(Orthanc)
 
 # Version of the build, should always be "mainline" except in release branches
-add_definitions(
-  -DORTHANC_VERSION="0.6.2"
-  )
+set(ORTHANC_VERSION "0.6.2")
 
 
 #####################################################################
@@ -120,6 +118,10 @@
 ## Build the core of Orthanc
 #####################################################################
 
+add_definitions(
+  -DORTHANC_VERSION="${ORTHANC_VERSION}"
+  )
+
 list(LENGTH OPENSSL_SOURCES OPENSSL_SOURCES_LENGTH)
 if (${OPENSSL_SOURCES_LENGTH} GREATER 0)
   add_library(OpenSSL STATIC ${OPENSSL_SOURCES})
@@ -337,6 +339,18 @@
     message(FATAL_ERROR "Support your platform here")
   endif()
 
+
+  # Set the version of the shared library for releases
+  string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" ORTHANC_IS_RELEASE ${ORTHANC_VERSION})
+  if (ORTHANC_IS_RELEASE)
+    string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1.\\2" ORTHANC_RELEASE ${ORTHANC_VERSION})
+    message("This is a release build, setting the version of the library to ${ORTHANC_RELEASE}")
+    set_target_properties(OrthancClient PROPERTIES VERSION ${ORTHANC_RELEASE} SOVERSION ${ORTHANC_RELEASE})
+  else()
+    message("This is not a release build")
+  endif()
+
+
   install(
     TARGETS OrthancClient
     RUNTIME DESTINATION lib    # Destination for Windows
@@ -350,6 +364,8 @@
 endif()
 
 
+        
+
 #####################################################################
 ## Generate the documentation if Doxygen is present
 #####################################################################
