# HG changeset patch # User Sebastien Jodogne # Date 1593495511 -7200 # Node ID 79d871605ffde5108df7235e0c8bf5e24e994836 # Parent c304ffca5d808beb1452094c3b3c6a30698ee198 sync diff -r c304ffca5d80 -r 79d871605ffd CMakeLists.txt --- a/CMakeLists.txt Fri Jan 31 17:51:30 2020 +0100 +++ b/CMakeLists.txt Tue Jun 30 07:38:31 2020 +0200 @@ -47,9 +47,15 @@ include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost) +set(ENABLE_MODULE_IMAGES OFF) +set(ENABLE_MODULE_JOBS OFF) +set(ENABLE_MODULE_DICOM OFF) include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) -include_directories(${ORTHANC_ROOT}) +include_directories( + ${ORTHANC_ROOT}/Core + ${ORTHANC_ROOT}/Plugins/Samples/Common + ) # Check that the Orthanc SDK headers are available diff -r c304ffca5d80 -r 79d871605ffd Plugin/AccessedResource.cpp --- a/Plugin/AccessedResource.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/AccessedResource.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "AccessedResource.h" -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/AssociativeArray.cpp --- a/Plugin/AssociativeArray.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/AssociativeArray.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "AssociativeArray.h" -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/AuthorizationParserBase.cpp --- a/Plugin/AuthorizationParserBase.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/AuthorizationParserBase.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "AuthorizationParserBase.h" -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/AuthorizationWebService.cpp --- a/Plugin/AuthorizationWebService.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/AuthorizationWebService.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,8 +18,8 @@ #include "AuthorizationWebService.h" -#include -#include +#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/CachedAuthorizationService.cpp --- a/Plugin/CachedAuthorizationService.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/CachedAuthorizationService.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "CachedAuthorizationService.h" -#include +#include #include diff -r c304ffca5d80 -r 79d871605ffd Plugin/DefaultAuthorizationParser.cpp --- a/Plugin/DefaultAuthorizationParser.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/DefaultAuthorizationParser.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "DefaultAuthorizationParser.h" -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/Enumerations.cpp --- a/Plugin/Enumerations.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/Enumerations.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -19,8 +19,8 @@ #include "Enumerations.h" -#include -#include +#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/Enumerations.h --- a/Plugin/Enumerations.h Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/Enumerations.h Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #pragma once -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/MemoryCache.h --- a/Plugin/MemoryCache.h Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/MemoryCache.h Tue Jun 30 07:38:31 2020 +0200 @@ -19,7 +19,8 @@ #pragma once #include "ICacheFactory.h" -#include + +#include #include diff -r c304ffca5d80 -r 79d871605ffd Plugin/OrthancResource.cpp --- a/Plugin/OrthancResource.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/OrthancResource.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "OrthancResource.h" -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/Plugin.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -22,9 +22,9 @@ #include "AuthorizationWebService.h" #include "MemoryCache.h" -#include -#include -#include +#include +#include +#include // Configuration of the authorization plugin @@ -256,7 +256,7 @@ return -1; } - Orthanc::Logging::Initialize(context); + Orthanc::Logging::InitializePluginContext(context); OrthancPluginSetDescription(context, "Advanced authorization plugin for Orthanc."); try diff -r c304ffca5d80 -r 79d871605ffd Plugin/ResourceHierarchyCache.cpp --- a/Plugin/ResourceHierarchyCache.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/ResourceHierarchyCache.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,8 +18,8 @@ #include "ResourceHierarchyCache.h" -#include -#include +#include +#include #include diff -r c304ffca5d80 -r 79d871605ffd Plugin/Token.cpp --- a/Plugin/Token.cpp Fri Jan 31 17:51:30 2020 +0100 +++ b/Plugin/Token.cpp Tue Jun 30 07:38:31 2020 +0200 @@ -18,7 +18,7 @@ #include "Token.h" -#include +#include namespace OrthancPlugins { diff -r c304ffca5d80 -r 79d871605ffd Resources/Orthanc/DownloadOrthancFramework.cmake --- a/Resources/Orthanc/DownloadOrthancFramework.cmake Fri Jan 31 17:51:30 2020 +0100 +++ b/Resources/Orthanc/DownloadOrthancFramework.cmake Tue Jun 30 07:38:31 2020 +0200 @@ -35,11 +35,12 @@ ## if (NOT DEFINED ORTHANC_FRAMEWORK_SOURCE OR - (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" AND + (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system" AND + NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "hg" AND NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "web" AND NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "archive" AND NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "path")) - message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_SOURCE must be set to \"hg\", \"web\", \"archive\" or \"path\"") + message(FATAL_ERROR "The variable ORTHANC_FRAMEWORK_SOURCE must be set to \"system\", \"hg\", \"web\", \"archive\" or \"path\"") endif() @@ -112,10 +113,30 @@ set(ORTHANC_FRAMEWORK_MD5 "e1b76f01116d9b5d4ac8cc39980560e3") elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.5.8") set(ORTHANC_FRAMEWORK_MD5 "82323e8c49a667f658a3639ea4dbc336") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.0") + set(ORTHANC_FRAMEWORK_MD5 "eab428d6e53f61e847fa360bb17ebe25") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.6.1") + set(ORTHANC_FRAMEWORK_MD5 "3971f5de96ba71dc9d3f3690afeaa7c0") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.0") + set(ORTHANC_FRAMEWORK_MD5 "ce5f689e852b01d3672bd3d2f952a5ef") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.7.1") + set(ORTHANC_FRAMEWORK_MD5 "3c171217f930abe80246997bdbcaf7cc") + + # Below this point are development snapshots that were used to + # release some plugin, before an official release of the Orthanc + # framework was available. Here is the command to be used to + # generate a proper archive: + # + # $ hg archive /tmp/Orthanc-`hg id -i | sed 's/\+//'`.tar.gz + # + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "ae0e3fd609df") + # DICOMweb 1.1 (framework pre-1.6.0) + set(ORTHANC_FRAMEWORK_MD5 "7e09e9b530a2f527854f0b782d7e0645") endif() endif() endif() -else() + +elseif (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") message("Using the Orthanc framework from a path of the filesystem. Assuming mainline version.") set(ORTHANC_FRAMEWORK_MAJOR 999) set(ORTHANC_FRAMEWORK_MINOR 999) @@ -203,7 +224,7 @@ else() message("Forking the Orthanc source repository using Mercurial") execute_process( - COMMAND ${ORTHANC_FRAMEWORK_HG} clone "https://bitbucket.org/sjodogne/orthanc" + COMMAND ${ORTHANC_FRAMEWORK_HG} clone "https://hg.orthanc-server.com/orthanc/" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} RESULT_VARIABLE Failure ) @@ -352,3 +373,125 @@ endif() endif() endif() + + + +## +## Case of the Orthanc framework installed as a shared library in a +## GNU/Linux distribution (typically Debian) +## + +if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") + set(ORTHANC_FRAMEWORK_LIBDIR "" CACHE PATH "") + + if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND + CMAKE_COMPILER_IS_GNUCXX) # MinGW + set(DYNAMIC_MINGW_STDLIB ON) # Disable static linking against libc (to throw exceptions) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++") + endif() + + include(CheckIncludeFile) + include(CheckIncludeFileCXX) + include(FindPythonInterp) + include(${CMAKE_CURRENT_LIST_DIR}/Compiler.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/DownloadPackage.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) + set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) + + if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND + NOT ORTHANC_FRAMEWORK_STATIC) + # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) + find_path(JSONCPP_INCLUDE_DIR json/reader.h + /usr/include/jsoncpp + /usr/local/include/jsoncpp + ) + + message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}") + include_directories(${JSONCPP_INCLUDE_DIR}) + link_libraries(jsoncpp) + + CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) + if (NOT HAVE_JSONCPP_H) + message(FATAL_ERROR "Please install the libjsoncpp-dev package") + endif() + + # Look for mandatory dependency Boost (cf. BoostConfiguration.cmake) + include(FindBoost) + find_package(Boost COMPONENTS filesystem thread system date_time regex) + + if (NOT Boost_FOUND) + message(FATAL_ERROR "Unable to locate Boost on this system") + endif() + + include_directories(${Boost_INCLUDE_DIRS}) + link_libraries(${Boost_LIBRARIES}) + + # Optional component - Lua + if (ENABLE_LUA) + include(FindLua) + + if (NOT LUA_FOUND) + message(FATAL_ERROR "Please install the liblua-dev package") + endif() + + include_directories(${LUA_INCLUDE_DIR}) + link_libraries(${LUA_LIBRARIES}) + endif() + + # Optional component - SQLite + if (ENABLE_SQLITE) + CHECK_INCLUDE_FILE(sqlite3.h HAVE_SQLITE_H) + if (NOT HAVE_SQLITE_H) + message(FATAL_ERROR "Please install the libsqlite3-dev package") + endif() + link_libraries(sqlite3) + endif() + endif() + + # Optional component - Google Test + if (ENABLE_GOOGLE_TEST) + set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") + set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") + mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) + include(${CMAKE_CURRENT_LIST_DIR}/GoogleTestConfiguration.cmake) + endif() + + # Look for Orthanc framework shared library + include(CheckCXXSymbolExists) + + if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + set(ORTHANC_FRAMEWORK_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}) + include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) + else() + find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h + /usr/include/orthanc-framework + /usr/local/include/orthanc-framework + ${ORTHANC_FRAMEWORK_ROOT} + ) + endif() + + message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}") + include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR}) + + set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") + + if (NOT "${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") + set(CMAKE_REQUIRED_LIBRARIES "-L${ORTHANC_FRAMEWORK_LIBDIR} -lOrthancFramework") + else() + set(CMAKE_REQUIRED_LIBRARIES "OrthancFramework") + endif() + + check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) + if(NOT HAVE_ORTHANC_FRAMEWORK) + message(FATAL_ERROR "Cannot find the Orthanc framework") + endif() + + if (NOT "${ORTHANC_FRAMEWORK_ROOT}" STREQUAL "") + include_directories(${ORTHANC_FRAMEWORK_ROOT}) + endif() + + if (NOT "${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") + link_directories(${ORTHANC_FRAMEWORK_LIBDIR}) + endif() +endif() diff -r c304ffca5d80 -r 79d871605ffd Resources/Orthanc/LinuxStandardBaseToolchain.cmake --- a/Resources/Orthanc/LinuxStandardBaseToolchain.cmake Fri Jan 31 17:51:30 2020 +0100 +++ b/Resources/Orthanc/LinuxStandardBaseToolchain.cmake Tue Jun 30 07:38:31 2020 +0200 @@ -1,11 +1,19 @@ -# LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu +# +# Full build, as used on the BuildBot CIS: +# +# $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DBOOST_LOCALE_BACKEND=icu -DENABLE_PKCS11=ON -G Ninja +# +# Or, more lightweight version (without libp11 and ICU): +# +# $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -G Ninja +# INCLUDE(CMakeForceCompiler) -SET(LSB_PATH $ENV{LSB_PATH}) -SET(LSB_CC $ENV{LSB_CC}) -SET(LSB_CXX $ENV{LSB_CXX}) -SET(LSB_TARGET_VERSION "4.0") +SET(LSB_PATH $ENV{LSB_PATH} CACHE STRING "") +SET(LSB_CC $ENV{LSB_CC} CACHE STRING "") +SET(LSB_CXX $ENV{LSB_CXX} CACHE STRING "") +SET(LSB_TARGET_VERSION "4.0" CACHE STRING "") IF ("${LSB_PATH}" STREQUAL "") SET(LSB_PATH "/opt/lsb") diff -r c304ffca5d80 -r 79d871605ffd Resources/Orthanc/Sdk-1.3.1/orthanc/OrthancCPlugin.h --- a/Resources/Orthanc/Sdk-1.3.1/orthanc/OrthancCPlugin.h Fri Jan 31 17:51:30 2020 +0100 +++ b/Resources/Orthanc/Sdk-1.3.1/orthanc/OrthancCPlugin.h Tue Jun 30 07:38:31 2020 +0200 @@ -74,7 +74,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017 Osimis, Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -r c304ffca5d80 -r 79d871605ffd Resources/SyncOrthancFolder.py --- a/Resources/SyncOrthancFolder.py Fri Jan 31 17:51:30 2020 +0100 +++ b/Resources/SyncOrthancFolder.py Tue Jun 30 07:38:31 2020 +0200 @@ -12,10 +12,10 @@ TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc') PLUGIN_SDK_VERSION = '1.3.1' -REPOSITORY = 'https://bitbucket.org/sjodogne/orthanc/raw' +REPOSITORY = 'https://hg.orthanc-server.com/orthanc/raw-file' FILES = [ - 'DownloadOrthancFramework.cmake', + 'CMake/DownloadOrthancFramework.cmake', 'LinuxStandardBaseToolchain.cmake', 'MinGW-W64-Toolchain32.cmake', 'MinGW-W64-Toolchain64.cmake', @@ -49,7 +49,7 @@ for f in FILES: commands.append([ 'default', os.path.join('Resources', f), - f ]) + os.path.basename(f) ]) for f in SDK: commands.append([