changeset 175:dd1ad819ca33

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Jan 2018 07:34:54 +0100
parents 81f16c5667ba
children 55f8cf4ea237
files CMakeLists.txt Orthanc/Core/ChunkedBuffer.cpp Orthanc/Core/ChunkedBuffer.h Orthanc/Core/DicomFormat/DicomMap.cpp Orthanc/Core/DicomFormat/DicomMap.h Orthanc/Core/DicomFormat/DicomTag.cpp Orthanc/Core/DicomFormat/DicomTag.h Orthanc/Core/DicomFormat/DicomValue.cpp Orthanc/Core/DicomFormat/DicomValue.h Orthanc/Core/Endianness.h Orthanc/Core/Enumerations.cpp Orthanc/Core/Enumerations.h Orthanc/Core/FileStorage/FilesystemStorage.cpp Orthanc/Core/FileStorage/FilesystemStorage.h Orthanc/Core/FileStorage/IStorageArea.h Orthanc/Core/IDynamicObject.h Orthanc/Core/Images/ImageAccessor.cpp Orthanc/Core/Images/ImageAccessor.h Orthanc/Core/Images/ImageBuffer.cpp Orthanc/Core/Images/ImageBuffer.h Orthanc/Core/Images/ImageProcessing.cpp Orthanc/Core/Images/ImageProcessing.h Orthanc/Core/Logging.h Orthanc/Core/MultiThreading/SharedMessageQueue.cpp Orthanc/Core/MultiThreading/SharedMessageQueue.h Orthanc/Core/OrthancException.h Orthanc/Core/PrecompiledHeaders.cpp Orthanc/Core/PrecompiledHeaders.h Orthanc/Core/SystemToolbox.cpp Orthanc/Core/SystemToolbox.h Orthanc/Core/Toolbox.cpp Orthanc/Core/Toolbox.h Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.h Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.h Orthanc/Resources/CMake/BoostConfiguration.cmake Orthanc/Resources/CMake/Compiler.cmake Orthanc/Resources/CMake/GoogleTestConfiguration.cmake Orthanc/Resources/CMake/JsonCppConfiguration.cmake Orthanc/Resources/CMake/SQLiteConfiguration.cmake Orthanc/Resources/CMake/UuidConfiguration.cmake Orthanc/Resources/EmbedResources.py Orthanc/Resources/WindowsResources.py Resources/BuildInstructions.txt Resources/SyncOrthancFolder.py
diffstat 48 files changed, 263 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Jan 02 09:59:39 2018 +0100
+++ b/CMakeLists.txt	Thu Jan 04 07:34:54 2018 +0100
@@ -33,8 +33,9 @@
 set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)")
 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
 set(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
+set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
 set(USE_SYSTEM_SQLITE ON CACHE BOOL "Use the system version of SQLite")
-set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
+set(USE_SYSTEM_UUID ON CACHE BOOL "Use the system version of the uuid library from e2fsprogs")
 
 # Distribution-specific settings
 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
@@ -43,6 +44,7 @@
 set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/Orthanc)
 set(ORTHANC_DISABLE_PATCH ON)  # No need for the "patch" command-line tool
 set(ENABLE_LOCALE OFF)         # Disable support for locales (notably in Boost)
+include(CheckIncludeFile)
 include(CheckIncludeFiles)
 include(CheckIncludeFileCXX)
 include(CheckLibraryExists)
@@ -55,6 +57,7 @@
 include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/GoogleTestConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/JsonCppConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/SQLiteConfiguration.cmake)
+include(${CMAKE_SOURCE_DIR}/Orthanc/Resources/CMake/UuidConfiguration.cmake)
 
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GdcmConfiguration.cmake)
 include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake)
@@ -136,8 +139,9 @@
 
 set(CORE_SOURCES
   ${BOOST_SOURCES}
+  ${JSONCPP_SOURCES}
   ${SQLITE_SOURCES}
-  ${JSONCPP_SOURCES}
+  ${UUID_SOURCES}
 
   # Sources inherited from Orthanc core
   ${CMAKE_SOURCE_DIR}/Orthanc/Core/ChunkedBuffer.cpp
--- a/Orthanc/Core/ChunkedBuffer.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/ChunkedBuffer.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/ChunkedBuffer.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/ChunkedBuffer.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/DicomFormat/DicomMap.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/DicomFormat/DicomMap.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/DicomFormat/DicomMap.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/DicomFormat/DicomMap.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/DicomFormat/DicomTag.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/DicomFormat/DicomTag.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/DicomFormat/DicomTag.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/DicomFormat/DicomTag.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/DicomFormat/DicomValue.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/DicomFormat/DicomValue.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/DicomFormat/DicomValue.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/DicomFormat/DicomValue.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Endianness.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Endianness.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -38,7 +38,12 @@
  ** LINUX-LIKE ARCHITECTURES
  ********************************************************************/
 
-#if defined(__linux__) || defined(__EMSCRIPTEN__)
+#if defined(__LSB_VERSION__)
+// Linux Standard Base (LSB) does not come with be16toh, be32toh, and
+// be64toh
+#  define ORTHANC_HAS_BUILTIN_BYTE_SWAP 0
+#  include <endian.h>
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #  define ORTHANC_HAS_BUILTIN_BYTE_SWAP 1
 #  include <endian.h>
 #endif
@@ -155,4 +160,38 @@
           static_cast<uint64_t>(p[7]));
 }
 
+#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
+#  if __BYTE_ORDER == __LITTLE_ENDIAN
+#    define be16toh(x) __orthanc_bswap16(x)
+#    define be32toh(x) __orthanc_bswap32(x)
+#    define be64toh(x) __orthanc_bswap64(x)
+#    define htobe16(x) __orthanc_bswap16(x)
+#    define htobe32(x) __orthanc_bswap32(x)
+#    define htobe64(x) __orthanc_bswap64(x)
+#    define htole16(x) x
+#    define htole32(x) x
+#    define htole64(x) x
+#    define le16toh(x) x
+#    define le32toh(x) x
+#    define le64toh(x) x
+#  elif __BYTE_ORDER == __BIG_ENDIAN
+#    define be16toh(x) x
+#    define be32toh(x) x
+#    define be64toh(x) x
+#    define htobe16(x) x
+#    define htobe32(x) x
+#    define htobe64(x) x
+#    define htole16(x) __orthanc_bswap16(x)
+#    define htole32(x) __orthanc_bswap32(x)
+#    define htole64(x) __orthanc_bswap64(x)
+#    define le16toh(x) __orthanc_bswap16(x)
+#    define le32toh(x) __orthanc_bswap32(x)
+#    define le64toh(x) __orthanc_bswap64(x)
+#  else
+#    error Please support your platform here
+#  endif
+#else
+#  error Please support your platform here
 #endif
+
+#endif
--- a/Orthanc/Core/Enumerations.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Enumerations.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Enumerations.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Enumerations.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/FileStorage/FilesystemStorage.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/FileStorage/FilesystemStorage.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/FileStorage/FilesystemStorage.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/FileStorage/FilesystemStorage.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/FileStorage/IStorageArea.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/FileStorage/IStorageArea.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/IDynamicObject.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/IDynamicObject.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Images/ImageAccessor.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Images/ImageAccessor.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Images/ImageAccessor.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Images/ImageAccessor.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Images/ImageBuffer.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Images/ImageBuffer.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Images/ImageBuffer.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Images/ImageBuffer.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Images/ImageProcessing.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Images/ImageProcessing.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Images/ImageProcessing.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Images/ImageProcessing.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Logging.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Logging.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/MultiThreading/SharedMessageQueue.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/MultiThreading/SharedMessageQueue.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/MultiThreading/SharedMessageQueue.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/MultiThreading/SharedMessageQueue.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/OrthancException.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/OrthancException.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/PrecompiledHeaders.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/PrecompiledHeaders.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/PrecompiledHeaders.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/PrecompiledHeaders.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/SystemToolbox.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/SystemToolbox.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/SystemToolbox.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/SystemToolbox.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Core/Toolbox.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Toolbox.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -534,7 +534,7 @@
 
     for (size_t i = 0; i < size; i++, p++)
     {
-      if (*p > 127 || (*p != 0 && iscntrl(*p)))
+      if (*p > 127 || *p == 0 || iscntrl(*p))
       {
         return false;
       }
@@ -544,6 +544,12 @@
   }
 
 
+  bool Toolbox::IsAsciiString(const std::string& s)
+  {
+    return IsAsciiString(s.c_str(), s.size());
+  }
+  
+
   std::string Toolbox::ConvertToAscii(const std::string& source)
   {
     std::string result;
--- a/Orthanc/Core/Toolbox.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Core/Toolbox.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -152,6 +152,8 @@
     bool IsAsciiString(const void* data,
                        size_t size);
 
+    bool IsAsciiString(const std::string& s);
+
     std::string ConvertToAscii(const std::string& source);
 
     std::string StripSpaces(const std::string& source);
--- a/Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.h	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.h	Thu Jan 04 07:34:54 2018 +0100
@@ -2,7 +2,7 @@
  * Orthanc - A Lightweight, RESTful DICOM Store
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017 Osimis, Belgium
+ * Copyright (C) 2017-2018 Osimis S.A., Belgium
  *
  * This program is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
--- a/Orthanc/Resources/CMake/BoostConfiguration.cmake	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/CMake/BoostConfiguration.cmake	Thu Jan 04 07:34:54 2018 +0100
@@ -41,12 +41,18 @@
   ## Parameters for static compilation of Boost 
   ##
   
-  set(BOOST_NAME boost_1_64_0)
-  set(BOOST_BCP_SUFFIX bcpdigest-1.3.0)
-  set(BOOST_MD5 "ecb266cf46adcc7f695ad12685871174")
+  set(BOOST_NAME boost_1_65_1)
+  set(BOOST_BCP_SUFFIX bcpdigest-1.3.1)
+  set(BOOST_MD5 "92c9c603e56bbd7a450a305f08747d90")
   set(BOOST_URL "http://www.orthanc-server.com/downloads/third-party/${BOOST_NAME}_${BOOST_BCP_SUFFIX}.tar.gz")
   set(BOOST_SOURCES_DIR ${CMAKE_BINARY_DIR}/${BOOST_NAME})
 
+  if (IS_DIRECTORY "${BOOST_SOURCES_DIR}")
+    set(FirstRun OFF)
+  else()
+    set(FirstRun ON)
+  endif()
+
   DownloadPackage(${BOOST_MD5} ${BOOST_URL} "${BOOST_SOURCES_DIR}")
 
 
@@ -78,7 +84,22 @@
     ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp
     )
 
+  if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
+    add_definitions(-DBOOST_SYSTEM_USE_STRERROR=1)
+    
+    execute_process(
+      COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
+      ${ORTHANC_ROOT}/Resources/Patches/boost-1.65.1-linux-standard-base.patch
+      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+      RESULT_VARIABLE Failure
+      )
 
+    if (FirstRun AND Failure)
+      message(FATAL_ERROR "Error while patching a file")
+    endif()
+  endif()
+
+  
   ##
   ## Configuration of boost::thread
   ##
@@ -199,13 +220,29 @@
       ${BOOST_SOURCES_DIR}/libs/locale/src/util/locale_data.cpp
       )        
 
-    if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
-        CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
-        CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
-        CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD" OR
-        CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
-        CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
-        CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
+    if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR
+        CMAKE_SYSTEM_VERSION STREQUAL "LinuxStandardBase")
+      list(APPEND BOOST_SOURCES
+        ${BOOST_SOURCES_DIR}/libs/locale/src/std/codecvt.cpp
+        ${BOOST_SOURCES_DIR}/libs/locale/src/std/collate.cpp
+        ${BOOST_SOURCES_DIR}/libs/locale/src/std/converter.cpp
+        ${BOOST_SOURCES_DIR}/libs/locale/src/std/numeric.cpp
+        ${BOOST_SOURCES_DIR}/libs/locale/src/std/std_backend.cpp
+        )
+
+      add_definitions(
+        -DBOOST_LOCALE_WITH_ICONV=1
+        -DBOOST_LOCALE_NO_WINAPI_BACKEND=1
+        -DBOOST_LOCALE_NO_POSIX_BACKEND=1
+        )
+      
+    elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
+            CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
+            CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
+            CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD" OR
+            CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
+            CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
+            CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
       list(APPEND BOOST_SOURCES
         ${BOOST_SOURCES_DIR}/libs/locale/src/posix/codecvt.cpp
         ${BOOST_SOURCES_DIR}/libs/locale/src/posix/collate.cpp
@@ -220,21 +257,6 @@
         -DBOOST_LOCALE_NO_STD_BACKEND=1
         )
       
-    elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
-      list(APPEND BOOST_SOURCES
-        ${BOOST_SOURCES_DIR}/libs/locale/src/std/codecvt.cpp
-        ${BOOST_SOURCES_DIR}/libs/locale/src/std/collate.cpp
-        ${BOOST_SOURCES_DIR}/libs/locale/src/std/converter.cpp
-        ${BOOST_SOURCES_DIR}/libs/locale/src/std/numeric.cpp
-        ${BOOST_SOURCES_DIR}/libs/locale/src/std/std_backend.cpp
-        )
-
-      add_definitions(
-        -DBOOST_LOCALE_WITH_ICONV=1
-        -DBOOST_LOCALE_NO_WINAPI_BACKEND=1
-        -DBOOST_LOCALE_NO_POSIX_BACKEND=1
-        )
-      
     elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
       list(APPEND BOOST_SOURCES
         ${BOOST_SOURCES_DIR}/libs/locale/src/win32/collate.cpp
--- a/Orthanc/Resources/CMake/Compiler.cmake	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/CMake/Compiler.cmake	Thu Jan 04 07:34:54 2018 +0100
@@ -1,6 +1,7 @@
 # This file sets all the compiler-related flags
 
-if (CMAKE_CROSSCOMPILING)
+if (CMAKE_CROSSCOMPILING OR
+    "${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
   # Cross-compilation necessarily implies standalone and static build
   SET(STATIC_BUILD ON)
   SET(STANDALONE_BUILD ON)
@@ -87,7 +88,7 @@
   # Remove the "-rdynamic" option
   # http://www.mail-archive.com/cmake@cmake.org/msg08837.html
   set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
-  link_libraries(uuid pthread)
+  link_libraries(pthread)
 
   if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
     link_libraries(rt)
@@ -117,11 +118,6 @@
       )
   endif()
 
-  CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
-  if (NOT HAVE_UUID_H)
-    message(FATAL_ERROR "Please install the uuid-dev package (or e2fsprogs if OpenBSD)")
-  endif()
-
 elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
   if (MSVC)
     message("MSVC compiler version = " ${MSVC_VERSION} "\n")
@@ -174,11 +170,6 @@
     )
   link_libraries(iconv)
 
-  CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
-  if (NOT HAVE_UUID_H)
-    message(FATAL_ERROR "Please install the uuid-dev package")
-  endif()
-
 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
   message("Building using Emscripten (for WebAssembly or asm.js targets)")
 
@@ -187,13 +178,6 @@
 endif()
 
 
-if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -nostdinc++ -I${LSB_PATH}/include -I${LSB_PATH}/include/c++ -I${LSB_PATH}/include/c++/backward -fpermissive")
-  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH}")
-endif()
-
-
 if (DEFINED ENABLE_PROFILING AND ENABLE_PROFILING)
   if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
     message(WARNING "Enabling profiling on a non-debug build will not produce full information")
@@ -211,6 +195,16 @@
 endif()
 
 
+if (CMAKE_COMPILER_IS_GNUCXX)
+  # "When creating a static library using binutils (ar) and there
+  # exist a duplicate object name (e.g. a/Foo.cpp.o, b/Foo.cpp.o), the
+  # resulting static library can end up having only one of the
+  # duplicate objects. [...] This bug only happens if there are many
+  # objects." https://cmake.org/Bug/view.php?id=14874
+  set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> <LINK_FLAGS> q <TARGET> <OBJECTS>")
+endif()
+
+
 if (STATIC_BUILD)
   add_definitions(-DORTHANC_STATIC=1)
 else()
--- a/Orthanc/Resources/CMake/GoogleTestConfiguration.cmake	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/CMake/GoogleTestConfiguration.cmake	Thu Jan 04 07:34:54 2018 +0100
@@ -47,7 +47,11 @@
   if (MSVC) # VS2012 does not support tuples correctly yet
     add_definitions(/D _VARIADIC_MAX=10)
   endif()
-
+  
+  if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
+    add_definitions(-DGTEST_HAS_CLONE=0)
+  endif()
+  
   source_group(ThirdParty\\GoogleTest REGULAR_EXPRESSION ${GOOGLE_TEST_SOURCES_DIR}/.*)
 
 else()
--- a/Orthanc/Resources/CMake/JsonCppConfiguration.cmake	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/CMake/JsonCppConfiguration.cmake	Thu Jan 04 07:34:54 2018 +0100
@@ -48,9 +48,10 @@
       JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1})
     message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}")
 
-    if (CMAKE_COMPILER_IS_GNUCXX AND 
+    if ((CMAKE_COMPILER_IS_GNUCXX OR
+          "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND 
         JSONCPP_VERSION_MAJOR GREATER 0)
-      message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0")
+      message("Switching to C++11 standard in gcc/clang, as version of JsonCpp is >= 1.0.0")
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations")
     endif()
   else()
--- a/Orthanc/Resources/CMake/SQLiteConfiguration.cmake	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/CMake/SQLiteConfiguration.cmake	Thu Jan 04 07:34:54 2018 +0100
@@ -15,11 +15,11 @@
 
 
 if (SQLITE_STATIC)
-  SET(SQLITE_SOURCES_DIR ${CMAKE_BINARY_DIR}/sqlite-amalgamation-3071300)
-  SET(SQLITE_MD5 "5fbeff9645ab035a1f580e90b279a16d")
-  SET(SQLITE_URL "http://www.orthanc-server.com/downloads/third-party/sqlite-amalgamation-3071300.zip")
+  SET(SQLITE_SOURCES_DIR ${CMAKE_BINARY_DIR}/sqlite-amalgamation-3210000)
+  SET(SQLITE_MD5 "fe330e88d81e77e1e61554a370ae5001")
+  SET(SQLITE_URL "http://www.orthanc-server.com/downloads/third-party/sqlite-amalgamation-3210000.zip")
 
-  add_definitions(-DORTHANC_SQLITE_VERSION=3007013)
+  add_definitions(-DORTHANC_SQLITE_VERSION=3021000)
 
   DownloadPackage(${SQLITE_MD5} ${SQLITE_URL} "${SQLITE_SOURCES_DIR}")
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Orthanc/Resources/CMake/UuidConfiguration.cmake	Thu Jan 04 07:34:54 2018 +0100
@@ -0,0 +1,94 @@
+if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+
+  if (STATIC_BUILD OR NOT USE_SYSTEM_UUID)
+    SET(E2FSPROGS_SOURCES_DIR ${CMAKE_BINARY_DIR}/e2fsprogs-1.43.8)
+    SET(E2FSPROGS_URL "http://www.orthanc-server.com/downloads/third-party/e2fsprogs-1.43.8.tar.gz")
+    SET(E2FSPROGS_MD5 "670b7a74a8ead5333acf21b9afc92b3c")
+
+    DownloadPackage(${E2FSPROGS_MD5} ${E2FSPROGS_URL} "${E2FSPROGS_SOURCES_DIR}")
+
+    include_directories(
+      ${E2FSPROGS_SOURCES_DIR}/lib
+      )
+
+    set(UUID_SOURCES
+      #${E2FSPROGS_SOURCES_DIR}/lib/uuid/tst_uuid.c
+      #${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_time.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/clear.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/compare.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/copy.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/gen_uuid.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/isnull.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/pack.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/parse.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unpack.c
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/unparse.c
+      )
+
+    check_include_file("net/if.h"       HAVE_NET_IF_H)
+    check_include_file("net/if_dl.h"    HAVE_NET_IF_DL_H)
+    check_include_file("netinet/in.h"   HAVE_NETINET_IN_H)
+    check_include_file("stdlib.h"       HAVE_STDLIB_H)
+    check_include_file("sys/file.h"     HAVE_SYS_FILE_H)
+    check_include_file("sys/ioctl.h"    HAVE_SYS_IOCTL_H)
+    check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H)
+    check_include_file("sys/socket.h"   HAVE_SYS_SOCKET_H)
+    check_include_file("sys/sockio.h"   HAVE_SYS_SOCKIO_H)
+    check_include_file("sys/syscall.h"  HAVE_SYS_SYSCALL_H)
+    check_include_file("sys/time.h"     HAVE_SYS_TIME_H)
+    check_include_file("sys/un.h"       HAVE_SYS_UN_H)
+    check_include_file("unistd.h"       HAVE_UNISTD_H)
+
+    file(WRITE ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake "
+#cmakedefine HAVE_NET_IF_H \@HAVE_NET_IF_H\@
+#cmakedefine HAVE_NET_IF_DL_H \@HAVE_NET_IF_DL_H\@
+#cmakedefine HAVE_NETINET_IN_H \@HAVE_NETINET_IN_H\@
+#cmakedefine HAVE_STDLIB_H \@HAVE_STDLIB_H \@
+#cmakedefine HAVE_SYS_FILE_H \@HAVE_SYS_FILE_H\@
+#cmakedefine HAVE_SYS_IOCTL_H \@HAVE_SYS_IOCTL_H\@
+#cmakedefine HAVE_SYS_RESOURCE_H \@HAVE_SYS_RESOURCE_H\@
+#cmakedefine HAVE_SYS_SOCKET_H \@HAVE_SYS_SOCKET_H\@
+#cmakedefine HAVE_SYS_SOCKIO_H \@HAVE_SYS_SOCKIO_H\@
+#cmakedefine HAVE_SYS_SYSCALL_H \@HAVE_SYS_SYSCALL_H\@
+#cmakedefine HAVE_SYS_TIME_H \@HAVE_SYS_TIME_H\@
+#cmakedefine HAVE_SYS_UN_H \@HAVE_SYS_UN_H\@
+#cmakedefine HAVE_UNISTD_H \@HAVE_UNISTD_H\@
+")
+    
+    configure_file(
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h
+      )
+    
+    
+    configure_file(
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h
+      )
+
+    file(WRITE
+      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h
+      "#include <stdint.h>\n")
+
+    #configure_file(
+    #  ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h.in
+    #  ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h
+    #  )
+    
+    source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*)
+
+  else()
+    CHECK_INCLUDE_FILE(uuid/uuid.h HAVE_UUID_H)
+    if (NOT HAVE_UUID_H)
+      message(FATAL_ERROR "Please install uuid-dev, e2fsprogs (OpenBSD) or e2fsprogs-libuuid (FreeBSD)")
+    endif()
+
+    check_library_exists(uuid uuid_generate_random "" HAVE_UUID_LIB)
+    if (NOT HAVE_UUID_LIB)
+      message(FATAL_ERROR "Unable to find the uuid library")
+    endif()
+    
+    link_libraries(uuid)
+  endif()
+
+endif()
--- a/Orthanc/Resources/EmbedResources.py	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/EmbedResources.py	Thu Jan 04 07:34:54 2018 +0100
@@ -3,7 +3,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017 Osimis, Belgium
+# Copyright (C) 2017-2018 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
--- a/Orthanc/Resources/WindowsResources.py	Tue Jan 02 09:59:39 2018 +0100
+++ b/Orthanc/Resources/WindowsResources.py	Thu Jan 04 07:34:54 2018 +0100
@@ -3,7 +3,7 @@
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 # Department, University Hospital of Liege, Belgium
-# Copyright (C) 2017 Osimis, Belgium
+# Copyright (C) 2017-2018 Osimis S.A., Belgium
 #
 # This program is free software: you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
--- a/Resources/BuildInstructions.txt	Tue Jan 02 09:59:39 2018 +0100
+++ b/Resources/BuildInstructions.txt	Thu Jan 04 07:34:54 2018 +0100
@@ -3,7 +3,7 @@
 
 # mkdir Build
 # cd Build
-# cmake .. -DCMAKE_BUILD_TYPE=Debug -DALLOW_DOWNLOADS=ON -DSTATIC_BUILD=ON
+# cmake .. -DCMAKE_BUILD_TYPE=Debug -DSTATIC_BUILD=ON
 # make
 
 
@@ -16,7 +16,7 @@
 
 # mkdir Build
 # cd Build
-# cmake .. -DCMAKE_BUILD_TYPE=Debug -DALLOW_DOWNLOADS=ON -DUSE_SYSTEM_GOOGLE_TEST=OFF -DSTANDALONE_BUILD=ON
+# cmake .. -DCMAKE_BUILD_TYPE=Debug -DALLOW_DOWNLOADS=ON -DUSE_SYSTEM_GOOGLE_TEST=OFF -DSTANDALONE_BUILD=ON -DUSE_SYSTEM_ORTHANC_SDK=OFF
 # make
 
 
--- a/Resources/SyncOrthancFolder.py	Tue Jan 02 09:59:39 2018 +0100
+++ b/Resources/SyncOrthancFolder.py	Thu Jan 04 07:34:54 2018 +0100
@@ -79,6 +79,7 @@
     'Resources/CMake/GoogleTestConfiguration.cmake',
     'Resources/CMake/JsonCppConfiguration.cmake',
     'Resources/CMake/SQLiteConfiguration.cmake',
+    'Resources/CMake/UuidConfiguration.cmake',
     'Resources/EmbedResources.py',
     'Resources/MinGW-W64-Toolchain32.cmake',
     'Resources/MinGW-W64-Toolchain64.cmake',