changeset 600:851b6a19a81c

setting soname
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Oct 2013 15:08:01 +0200
parents e51543cdbffd
children 84011417321d
files CMakeLists.txt
diffstat 1 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Oct 04 16:55:53 2013 +0200
+++ b/CMakeLists.txt	Thu Oct 10 15:08:01 2013 +0200
@@ -3,9 +3,7 @@
 project(Orthanc)
 
 # Version of the build, should always be "mainline" except in release branches
-add_definitions(
-  -DORTHANC_VERSION="mainline"
-  )
+set(ORTHANC_VERSION "mainline")
 
 
 #####################################################################
@@ -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
 #####################################################################