changeset 601:84011417321d

better version handling
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 11 Oct 2013 12:06:55 +0200
parents 851b6a19a81c
children d5043ff68d58
files CMakeLists.txt OrthancCppClient/SharedLibrary/AUTOGENERATED/OrthancCppClient.h
diffstat 2 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Thu Oct 10 15:08:01 2013 +0200
+++ b/CMakeLists.txt	Fri Oct 11 12:06:55 2013 +0200
@@ -340,15 +340,20 @@
   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()
+  # Set the version of the "Orthanc Client" shared library
+  file(STRINGS
+    ${CMAKE_SOURCE_DIR}/OrthancCppClient/SharedLibrary/Product.json
+    ORTHANC_CLIENT_VERSION_TMP
+    REGEX "^[ \t]*\"Version\"[ \t]*")
+
+  string(REGEX REPLACE "^.*\"([0-9]+)\\.([0-9]+)\\.([0-9]+)\"" "\\1.\\2" 
+    ORTHANC_CLIENT_VERSION ${ORTHANC_CLIENT_VERSION_TMP})
+
+  message("Setting the version of the library to ${ORTHANC_CLIENT_VERSION}")
+
+  set_target_properties(OrthancClient PROPERTIES 
+    VERSION ${ORTHANC_CLIENT_VERSION} 
+    SOVERSION ${ORTHANC_CLIENT_VERSION})
 
 
   install(
--- a/OrthancCppClient/SharedLibrary/AUTOGENERATED/OrthancCppClient.h	Thu Oct 10 15:08:01 2013 +0200
+++ b/OrthancCppClient/SharedLibrary/AUTOGENERATED/OrthancCppClient.h	Fri Oct 11 12:06:55 2013 +0200
@@ -81,9 +81,9 @@
 
 /* cf. http://sourceforge.net/p/predef/wiki/Architectures/ */
 #ifdef __amd64__
-#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient.so"
+#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient.so.0.6"
 #else
-#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient.so"
+#define LAAW_ORTHANC_CLIENT_DEFAULT_PATH  "libOrthancClient.so.0.6"
 #endif
 
 #define LAAW_ORTHANC_CLIENT_CALL_CONV