# HG changeset patch # User Sebastien Jodogne # Date 1381410481 -7200 # Node ID 851b6a19a81c5ed8caa013de76491e0e9f4ca5cd # Parent e51543cdbffd9dfae4957df4e58f94e9f7166b62 setting soname diff -r e51543cdbffd -r 851b6a19a81c CMakeLists.txt --- 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 #####################################################################