diff CMakeLists.txt @ 100:e2b2e1d4e1bb

fixed compatibility with Orthanc SDK 1.8.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Feb 2022 07:30:33 +0100
parents 465bf098554b
children 461dfb859ac7
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Dec 14 10:06:16 2021 +0100
+++ b/CMakeLists.txt	Wed Feb 23 07:30:33 2022 +0100
@@ -33,9 +33,9 @@
 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework")
 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
+set(USE_FRAMEWORK_ORTHANC_SDK OFF CACHE BOOL "Whether to use the SDK from the Orthanc sources (for developers only, to support new features of the SDK that are still pending in the mainline)")
 
 # Advanced parameters to fine-tune linking against system libraries
-set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
 set(ORTHANC_FRAMEWORK_STATIC OFF CACHE BOOL "If linking against the Orthanc framework system library, indicates whether this library was statically linked")
 mark_as_advanced(ORTHANC_FRAMEWORK_STATIC)
 
@@ -151,9 +151,15 @@
 endif()
 
 
-include_directories(
-  ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.9.8
-  )
+if (USE_FRAMEWORK_ORTHANC_SDK)
+  include_directories(
+    ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include
+    )
+else()
+  include_directories(
+    ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.8.1
+    )
+endif()
 
 add_definitions(
   -DHAS_ORTHANC_EXCEPTION=0