# HG changeset patch # User Sebastien Jodogne # Date 1693806569 -7200 # Node ID 1719a68fd4fa0875aacc910e04a327b69c95654d # Parent 8ccaf9f005a783c7ccd0a98aa438c58bd07a922a hotfix to compile against system-wide Orthanc framework diff -r 8ccaf9f005a7 -r 1719a68fd4fa CMakeLists.txt --- 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) diff -r 8ccaf9f005a7 -r 1719a68fd4fa Plugin/WadoRs.cpp --- 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& data) +{ + std::string s; + + for (std::set::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 currentInstancesIds; Orthanc::SerializationToolbox::ReadSetOfStrings(currentInstancesIds, seriesInfo, "Instances"); std::string currentInstancesMd5; - Orthanc::Toolbox::ComputeMD5(currentInstancesMd5, currentInstancesIds); + ComputeMD5OfSet(currentInstancesMd5, currentInstancesIds); if (currentInstancesMd5 == instancesMd5InCache) {