Mercurial > hg > orthanc
comparison CMakeLists.txt @ 601:84011417321d
better version handling
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 11 Oct 2013 12:06:55 +0200 |
parents | 851b6a19a81c |
children | b82292ba2083 ce5d2040c47b |
comparison
equal
deleted
inserted
replaced
600:851b6a19a81c | 601:84011417321d |
---|---|
338 else() | 338 else() |
339 message(FATAL_ERROR "Support your platform here") | 339 message(FATAL_ERROR "Support your platform here") |
340 endif() | 340 endif() |
341 | 341 |
342 | 342 |
343 # Set the version of the shared library for releases | 343 # Set the version of the "Orthanc Client" shared library |
344 string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" ORTHANC_IS_RELEASE ${ORTHANC_VERSION}) | 344 file(STRINGS |
345 if (ORTHANC_IS_RELEASE) | 345 ${CMAKE_SOURCE_DIR}/OrthancCppClient/SharedLibrary/Product.json |
346 string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1.\\2" ORTHANC_RELEASE ${ORTHANC_VERSION}) | 346 ORTHANC_CLIENT_VERSION_TMP |
347 message("This is a release build, setting the version of the library to ${ORTHANC_RELEASE}") | 347 REGEX "^[ \t]*\"Version\"[ \t]*") |
348 set_target_properties(OrthancClient PROPERTIES VERSION ${ORTHANC_RELEASE} SOVERSION ${ORTHANC_RELEASE}) | 348 |
349 else() | 349 string(REGEX REPLACE "^.*\"([0-9]+)\\.([0-9]+)\\.([0-9]+)\"" "\\1.\\2" |
350 message("This is not a release build") | 350 ORTHANC_CLIENT_VERSION ${ORTHANC_CLIENT_VERSION_TMP}) |
351 endif() | 351 |
352 message("Setting the version of the library to ${ORTHANC_CLIENT_VERSION}") | |
353 | |
354 set_target_properties(OrthancClient PROPERTIES | |
355 VERSION ${ORTHANC_CLIENT_VERSION} | |
356 SOVERSION ${ORTHANC_CLIENT_VERSION}) | |
352 | 357 |
353 | 358 |
354 install( | 359 install( |
355 TARGETS OrthancClient | 360 TARGETS OrthancClient |
356 RUNTIME DESTINATION lib # Destination for Windows | 361 RUNTIME DESTINATION lib # Destination for Windows |