changeset 2278:81400c2b9cae default tip

added support for ORTHANC_ENABLE_THREADS from Orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Aug 2026 11:01:24 +0200
parents 060c121b4946
children
files Applications/Samples/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/CMakeLists.txt OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake OrthancStone/Resources/WebAssemblySharedLibrary/CMakeLists.txt OrthancStone/Resources/WebAssemblyUnitTests/CMakeLists.txt
diffstat 5 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/WebAssembly/CMakeLists.txt	Fri Aug 14 09:12:12 2026 +0200
+++ b/Applications/Samples/WebAssembly/CMakeLists.txt	Fri Aug 14 11:01:24 2026 +0200
@@ -65,6 +65,7 @@
 SET(ENABLE_LOCALE ON)  # Necessary for text rendering
 SET(ENABLE_MODULE_JOBS OFF)
 SET(ORTHANC_SANDBOXED ON)
+SET(ORTHANC_ENABLE_THREADS OFF)  # Compatibility with Orthanc framework >= 1.13.0
 
 # this will set up the build system for Stone of Orthanc and will
 # populate the ORTHANC_STONE_SOURCES CMake variable
--- a/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt	Fri Aug 14 09:12:12 2026 +0200
+++ b/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt	Fri Aug 14 11:01:24 2026 +0200
@@ -59,6 +59,7 @@
 SET(ENABLE_MODULE_JOBS OFF)
 SET(ENABLE_PUGIXML ON) # Necessary for OsiriX annotations
 SET(ORTHANC_SANDBOXED ON)
+SET(ORTHANC_ENABLE_THREADS OFF)  # Compatibility with Orthanc framework >= 1.13.0
 
 # this will set up the build system for Stone of Orthanc and will
 # populate the ORTHANC_STONE_SOURCES CMake variable
--- a/OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake	Fri Aug 14 09:12:12 2026 +0200
+++ b/OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake	Fri Aug 14 11:01:24 2026 +0200
@@ -104,10 +104,17 @@
 endif()
 
 
-if (ENABLE_THREADS)
-  add_definitions(-DORTHANC_ENABLE_THREADS=1)
+if (DEFINED ORTHANC_ENABLE_THREADS)   # Compatibility with Orthanc framework >= 1.13.0
+  if ((ORTHANC_ENABLE_THREADS AND NOT ENABLE_THREADS) OR
+      (NOT ORTHANC_ENABLE_THREADS AND ENABLE_THREADS))
+    message(FATAL_ERROR "Mismatch between ORTHANC_ENABLE_THREADS and ENABLE_THREADS")
+  endif()
 else()
-  add_definitions(-DORTHANC_ENABLE_THREADS=0)
+  if (ENABLE_THREADS)
+    add_definitions(-DORTHANC_ENABLE_THREADS=1)
+  else()
+    add_definitions(-DORTHANC_ENABLE_THREADS=0)
+  endif()
 endif()
 
 
--- a/OrthancStone/Resources/WebAssemblySharedLibrary/CMakeLists.txt	Fri Aug 14 09:12:12 2026 +0200
+++ b/OrthancStone/Resources/WebAssemblySharedLibrary/CMakeLists.txt	Fri Aug 14 11:01:24 2026 +0200
@@ -68,6 +68,7 @@
 SET(ENABLE_GOOGLE_TEST OFF)
 SET(ENABLE_LOCALE ON)  # Necessary for text rendering
 SET(ORTHANC_SANDBOXED ON)
+SET(ORTHANC_ENABLE_THREADS OFF)  # Compatibility with Orthanc framework >= 1.13.0
 
 include(${CMAKE_SOURCE_DIR}/../OrthancStoneWebAssemblyConfiguration.cmake)
 
--- a/OrthancStone/Resources/WebAssemblyUnitTests/CMakeLists.txt	Fri Aug 14 09:12:12 2026 +0200
+++ b/OrthancStone/Resources/WebAssemblyUnitTests/CMakeLists.txt	Fri Aug 14 11:01:24 2026 +0200
@@ -62,6 +62,7 @@
 SET(ENABLE_MODULE_JOBS OFF)
 SET(ENABLE_PUGIXML ON) # Necessary for the tests of the Orthanc framework
 SET(ORTHANC_SANDBOXED ON)
+SET(ORTHANC_ENABLE_THREADS OFF)  # Compatibility with Orthanc framework >= 1.13.0
 
 # this will set up the build system for Stone of Orthanc and will
 # populate the ORTHANC_STONE_SOURCES CMake variable