changeset 201:97f18498af7e

added cmake option ORTHANC_SDK_VERSION
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 Jun 2024 12:38:44 +0200
parents 9c335e088f17
children bb19f1ed9cd9 55fab84a0674
files Aws/CMakeLists.txt
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Aws/CMakeLists.txt	Wed Jun 26 12:23:59 2024 +0200
+++ b/Aws/CMakeLists.txt	Wed Jun 26 12:38:44 2024 +0200
@@ -41,6 +41,10 @@
 set(USE_VCPKG_PACKAGES ON CACHE BOOL "Use Microsoft vcpkg to link against crypto++ and AWS SDK")
 set(USE_SYSTEM_CRYPTOPP ON CACHE BOOL "Use the system version of crypto++")
 
+
+set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
+set(ORTHANC_SDK_VERSION "1.12.1" CACHE STRING "Version of the Orthanc plugin SDK to use, if not using the system version (can be \"framework\" or \"1.12.1\")")
+
 include(CheckIncludeFileCXX)
 
 # Download and setup the Orthanc framework
@@ -98,6 +102,22 @@
 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
 
 
+if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
+  if (ORTHANC_SDK_VERSION STREQUAL "1.12.1")
+    include_directories(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Sdk-1.12.1/)
+  elseif (ORTHANC_SDK_VERSION STREQUAL "framework")
+    include_directories(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include/)
+  else()
+    message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}")
+  endif()
+else ()
+  CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
+  if (NOT HAVE_ORTHANC_H)
+    message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK")
+  endif()
+endif()
+
+
 add_definitions(
   -DHAS_ORTHANC_EXCEPTION=1
   -DORTHANC_ENABLE_LOGGING=1
@@ -107,7 +127,6 @@
 
 include_directories(
   ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/
-  ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Sdk-1.12.1/
   )