# HG changeset patch # User Sebastien Jodogne # Date 1591784301 -7200 # Node ID 5e26d004838c431f506addc07d5ea85327eb2b43 # Parent 78ee0155ec6721e165ea94641512d295eead3366 adding option "system" to DownloadOrthancFramework.cmake diff -r 78ee0155ec67 -r 5e26d004838c Core/FileStorage/FilesystemStorage.h --- a/Core/FileStorage/FilesystemStorage.h Wed Jun 10 10:14:15 2020 +0200 +++ b/Core/FileStorage/FilesystemStorage.h Wed Jun 10 12:18:21 2020 +0200 @@ -51,7 +51,7 @@ namespace Orthanc { - class FilesystemStorage : public IStorageArea + class ORTHANC_PUBLIC FilesystemStorage : public IStorageArea { // TODO REMOVE THIS friend class FilesystemHttpSender; diff -r 78ee0155ec67 -r 5e26d004838c Core/IDynamicObject.h --- a/Core/IDynamicObject.h Wed Jun 10 10:14:15 2020 +0200 +++ b/Core/IDynamicObject.h Wed Jun 10 12:18:21 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "OrthancFramework.h" + #include namespace Orthanc @@ -43,7 +45,7 @@ * Being a child of IDynamicObject only implies the existence of a * virtual destructor. **/ - class IDynamicObject : public boost::noncopyable + class ORTHANC_PUBLIC IDynamicObject : public boost::noncopyable { public: virtual ~IDynamicObject() diff -r 78ee0155ec67 -r 5e26d004838c Core/MultiThreading/SharedMessageQueue.h --- a/Core/MultiThreading/SharedMessageQueue.h Wed Jun 10 10:14:15 2020 +0200 +++ b/Core/MultiThreading/SharedMessageQueue.h Wed Jun 10 12:18:21 2020 +0200 @@ -41,7 +41,7 @@ namespace Orthanc { - class SharedMessageQueue : public boost::noncopyable + class ORTHANC_PUBLIC SharedMessageQueue : public boost::noncopyable { private: typedef std::list Queue; diff -r 78ee0155ec67 -r 5e26d004838c Plugins/Samples/ConnectivityChecks/CMakeLists.txt --- a/Plugins/Samples/ConnectivityChecks/CMakeLists.txt Wed Jun 10 10:14:15 2020 +0200 +++ b/Plugins/Samples/ConnectivityChecks/CMakeLists.txt Wed Jun 10 12:18:21 2020 +0200 @@ -27,6 +27,7 @@ endif() EmbedResources( + --framework-path=${CMAKE_CURRENT_SOURCE_DIR}/../../../Core WEB_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/WebResources LIBRARIES ${JAVASCRIPT_LIBS_DIR} ) diff -r 78ee0155ec67 -r 5e26d004838c Resources/DownloadOrthancFramework.cmake --- a/Resources/DownloadOrthancFramework.cmake Wed Jun 10 10:14:15 2020 +0200 +++ b/Resources/DownloadOrthancFramework.cmake Wed Jun 10 12:18:21 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() @@ -371,3 +372,80 @@ 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 "") + + 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) + + # 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}) + + # Look for Orthanc framework shared library + include(CheckCXXSymbolExists) + + find_path(ORTHANC_FRAMEWORK_INCLUDE_DIR OrthancFramework.h + /usr/include/orthanc-framework + /usr/local/include/orthanc-framework + ${ORTHANC_FRAMEWORK_ROOT} + ) + + 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()