# HG changeset patch # User Sebastien Jodogne # Date 1719398324 -7200 # Node ID 97f18498af7e3d60af38c0bd4f6fe231121724b8 # Parent 9c335e088f17b4ed6f809ca8aa9f42343396681c added cmake option ORTHANC_SDK_VERSION diff -r 9c335e088f17 -r 97f18498af7e Aws/CMakeLists.txt --- 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/ )