Description: Fix the linking of the shared library
Author: Sebastien Jodogne <s.jodogne@gmail.com>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: OrthancDicomWeb-0.2/CMakeLists.txt
===================================================================
--- OrthancDicomWeb-0.2.orig/CMakeLists.txt
+++ OrthancDicomWeb-0.2/CMakeLists.txt
@@ -47,7 +47,7 @@ include(CheckIncludeFileCXX)
 include(CheckLibraryExists)
 include(FindPythonInterp)
 include(${ORTHANC_ROOT}/Resources/CMake/Compiler.cmake)
-include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
+#include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
 
 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake)
 include(${ORTHANC_ROOT}/Resources/CMake/GoogleTestConfiguration.cmake)
@@ -130,15 +130,13 @@ add_library(OrthancDicomWeb SHARED ${COR
   ${AUTOGENERATED_SOURCES}
   )
 
-target_link_libraries(OrthancDicomWeb ${GDCM_LIBRARIES})
-
 message("Setting the version of the library to ${ORTHANC_DICOM_WEB_VERSION}")
 
 add_definitions(-DORTHANC_DICOM_WEB_VERSION="${ORTHANC_DICOM_WEB_VERSION}")
 
-set_target_properties(OrthancDicomWeb PROPERTIES 
-  VERSION ${ORTHANC_DICOM_WEB_VERSION} 
-  SOVERSION ${ORTHANC_DICOM_WEB_VERSION}
+set_target_properties(OrthancDicomWeb PROPERTIES
+  NO_SONAME ON
+  LINK_FLAGS "-lgdcmDICT -lgdcmDSED -lgdcmMSFF -lgdcmCommon -luuid -Wl,-soname,libOrthancDicomWeb.so.${ORTHANC_DICOM_WEB_VERSION}"
   )
 
 install(
Index: OrthancDicomWeb-0.2/Orthanc/Resources/CMake/Compiler.cmake
===================================================================
--- OrthancDicomWeb-0.2.orig/Orthanc/Resources/CMake/Compiler.cmake
+++ OrthancDicomWeb-0.2/Orthanc/Resources/CMake/Compiler.cmake
@@ -55,7 +55,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux
   # Remove the "-rdynamic" option
   # http://www.mail-archive.com/cmake@cmake.org/msg08837.html
   set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
-  link_libraries(uuid pthread rt)
+  link_libraries(pthread rt)
 
   if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
@@ -134,17 +134,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeB
 endif()
 
 
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-  CHECK_INCLUDE_FILES(rpc.h HAVE_UUID_H)
-else()
-  CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
-endif()
-
-if (NOT HAVE_UUID_H)
-  message(FATAL_ERROR "Please install the uuid-dev package")
-endif()
-
-
 if (STATIC_BUILD)
   add_definitions(-DORTHANC_STATIC=1)
 else()
