# HG changeset patch # User Sebastien Jodogne # Date 1589884724 -7200 # Node ID 4f6495e050843284cdde65cc09b95433855e78d8 # Parent cfceeebf12a59930685fdaa1ab5a15def89dd8c6 CMake option: ORTHANC_SDK_VERSION diff -r cfceeebf12a5 -r 4f6495e05084 CMakeLists.txt --- a/CMakeLists.txt Fri May 15 16:18:20 2020 +0200 +++ b/CMakeLists.txt Tue May 19 12:38:44 2020 +0200 @@ -45,6 +45,7 @@ # Advanced parameters to fine-tune linking against system libraries set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)") set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") +set(ORTHANC_SDK_VERSION "0.9.5" CACHE STRING "Version of the Orthanc plugin SDK to use, if not using the system version (can be \"0.9.5\", or \"framework\")") # Download and setup the Orthanc framework @@ -65,7 +66,13 @@ # Check that the Orthanc SDK headers are available if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) - include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-0.9.5) + if (ORTHANC_SDK_VERSION STREQUAL "0.9.5") + include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-0.9.5) + elseif (ORTHANC_SDK_VERSION STREQUAL "framework") + include_directories(${ORTHANC_ROOT}/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) diff -r cfceeebf12a5 -r 4f6495e05084 Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Fri May 15 16:18:20 2020 +0200 +++ b/Plugin/Plugin.cpp Tue May 19 12:38:44 2020 +0200 @@ -30,6 +30,7 @@ #include #include #include +#include static OrthancPlugins::GdcmDecoderCache cache_; @@ -250,7 +251,7 @@ "GDCM cannot generate a UID"); } - gdcm::Attribute<0x0008,0x0018> sopInstanceUid; + gdcm::Keywords::SOPInstanceUID sopInstanceUid; sopInstanceUid.SetValue(uid); reader.GetFile().GetDataSet().Replace(sopInstanceUid.GetAsDataElement()); *hasSopInstanceUidChanged = 1;