changeset 628:1719a68fd4fa OrthancDicomWeb-1.15

hotfix to compile against system-wide Orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Sep 2023 07:49:29 +0200
parents 8ccaf9f005a7
children 6fc1fc5da5f4
files CMakeLists.txt Plugin/WadoRs.cpp
diffstat 2 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Thu Aug 24 16:29:33 2023 +0200
+++ b/CMakeLists.txt	Mon Sep 04 07:49:29 2023 +0200
@@ -54,6 +54,10 @@
 set(BUILD_BABEL_POLYFILL OFF CACHE BOOL "Retrieve babel-polyfill from npm")
 
 
+# Hotfix to compile against system-wide Orthanc framework
+function(DefineSourceBasenameForTarget targetname)
+endfunction()
+
 
 # Download and setup the Orthanc framework
 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
--- a/Plugin/WadoRs.cpp	Thu Aug 24 16:29:33 2023 +0200
+++ b/Plugin/WadoRs.cpp	Mon Sep 04 07:49:29 2023 +0200
@@ -70,6 +70,20 @@
 }
 
 
+// Hotfix: This function corresponds to a new signature introduced in Orthanc > 1.12.1
+static void ComputeMD5OfSet(std::string& result,
+                            const std::set<std::string>& data)
+{
+  std::string s;
+
+  for (std::set<std::string>::const_iterator it = data.begin(); it != data.end(); ++it)
+  {
+    s += *it;
+  }
+
+  Orthanc::Toolbox::ComputeMD5(result, s);
+}
+
 
 namespace
 {
@@ -1397,7 +1411,7 @@
   // save in attachments for future use
   Orthanc::IBufferCompressor::Compress(compressedSeriesMetadata, compressor, serializedSeriesMetadata);
   std::string instancesMd5;
-  Orthanc::Toolbox::ComputeMD5(instancesMd5, instancesIds);
+  ComputeMD5OfSet(instancesMd5, instancesIds);
 
   std::string cacheContent = "2;" + instancesMd5 + ";" + compressedSeriesMetadata; 
 
@@ -1520,7 +1534,7 @@
         std::set<std::string> currentInstancesIds;
         Orthanc::SerializationToolbox::ReadSetOfStrings(currentInstancesIds, seriesInfo, "Instances");
         std::string currentInstancesMd5;
-        Orthanc::Toolbox::ComputeMD5(currentInstancesMd5, currentInstancesIds);
+        ComputeMD5OfSet(currentInstancesMd5, currentInstancesIds);
 
         if (currentInstancesMd5 == instancesMd5InCache)
         {