diff OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake @ 4063:e00f3d089991 framework

shared library of orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Jun 2020 16:40:34 +0200
parents d25f4c0fa160
children d6b7fb0f9652
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake	Thu Jun 11 14:38:31 2020 +0200
+++ b/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake	Thu Jun 11 16:40:34 2020 +0200
@@ -399,8 +399,10 @@
   include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake)
   set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py)
 
-  if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND
-      NOT ORTHANC_FRAMEWORK_STATIC)
+  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR
+      ORTHANC_FRAMEWORK_STATIC)
+    include_directories(${ORTHANC_FRAMEWORK_ROOT}/..)
+  else()
     # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake)
     find_path(JSONCPP_INCLUDE_DIR json/reader.h
       /usr/include/jsoncpp
@@ -447,6 +449,22 @@
       endif()
       link_libraries(sqlite3)
     endif()
+
+    # Optional component - Pugixml
+    if (ENABLE_PUGIXML)
+      CHECK_INCLUDE_FILE_CXX(pugixml.hpp HAVE_PUGIXML_H)
+      if (NOT HAVE_PUGIXML_H)
+        message(FATAL_ERROR "Please install the libpugixml-dev package")
+      endif()      
+      link_libraries(pugixml)
+    endif()
+
+    # Optional component - DCMTK
+    if (ENABLE_DCMTK)
+      include(FindDCMTK)
+      include_directories(${DCMTK_INCLUDE_DIRS})
+      link_libraries(${DCMTK_LIBRARIES})
+    endif()
   endif()
 
   # Optional component - Google Test
@@ -462,7 +480,6 @@
 
   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
     set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT})
-    include_directories(${ORTHANC_FRAMEWORK_ROOT}/..)
   else()
     find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h
       /usr/include/orthanc-framework