# HG changeset patch # User Sebastien Jodogne # Date 1423830481 -3600 # Node ID f497a72d9f71be974d38fbf623cd454436d6ac9d # Parent 0f9e0e808e0f6a4af10062b8fc95adf1de2a7d8d fixes to the sample plugins diff -r 0f9e0e808e0f -r f497a72d9f71 Core/Toolbox.h --- a/Core/Toolbox.h Fri Feb 13 09:51:22 2015 +0100 +++ b/Core/Toolbox.h Fri Feb 13 13:28:01 2015 +0100 @@ -37,7 +37,10 @@ #include #include #include + +#if ORTHANC_PUGIXML_ENABLED == 1 #include +#endif namespace Orthanc { diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Include/OrthancCPlugin.h --- a/Plugins/Include/OrthancCPlugin.h Fri Feb 13 09:51:22 2015 +0100 +++ b/Plugins/Include/OrthancCPlugin.h Fri Feb 13 13:28:01 2015 +0100 @@ -132,9 +132,11 @@ ** Inclusion of standard libraries. ********************************************************************/ -// For Microsoft Visual Studio, a compatibility "stdint.h" can be -// downloaded at the following URL: -// https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h +/** + * For Microsoft Visual Studio, a compatibility "stdint.h" can be + * downloaded at the following URL: + * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h + **/ #include #include diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/Basic/CMakeLists.txt --- a/Plugins/Samples/Basic/CMakeLists.txt Fri Feb 13 09:51:22 2015 +0100 +++ b/Plugins/Samples/Basic/CMakeLists.txt Fri Feb 13 13:28:01 2015 +0100 @@ -7,7 +7,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror") endif() -include_directories(${CMAKE_SOURCE_DIR}/../../OrthancCPlugin/) +include_directories(${CMAKE_SOURCE_DIR}/../../Include/) add_library(PluginTest SHARED Plugin.c) if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/GdcmDecoding/CMakeLists.txt --- a/Plugins/Samples/GdcmDecoding/CMakeLists.txt Fri Feb 13 09:51:22 2015 +0100 +++ b/Plugins/Samples/GdcmDecoding/CMakeLists.txt Fri Feb 13 13:28:01 2015 +0100 @@ -27,7 +27,7 @@ endif(GDCM_FOUND) include_directories( - ${ORTHANC_ROOT}/Plugins/OrthancCPlugin/ + ${ORTHANC_ROOT}/Plugins/Include/ ${ORTHANC_ROOT}/OrthancCppClient/SharedLibrary/Laaw ) diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/ServeFolders/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Samples/ServeFolders/CMakeLists.txt Fri Feb 13 13:28:01 2015 +0100 @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.8) + +project(ServeFolders) + +if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + link_libraries(uuid) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread") +elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + link_libraries(rpcrt4 ws2_32 secur32) + if (CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") + endif() +endif () + +if (CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/VersionScript.map -Wl,--no-undefined") +endif() + +include_directories(${CMAKE_SOURCE_DIR}/../../Include/) +add_library(PluginTest SHARED Plugin.cpp) + +if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + # Linking with "pthread" is necessary, otherwise the software crashes + # http://sourceware.org/bugzilla/show_bug.cgi?id=10652#c17 + target_link_libraries(PluginTest pthread dl) +endif() diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/ServeFolders/Plugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Samples/ServeFolders/Plugin.cpp Fri Feb 13 13:28:01 2015 +0100 @@ -0,0 +1,84 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + **/ + + +#include + +#include +#include + +static OrthancPluginContext* context_ = NULL; + + +static int32_t Callback(OrthancPluginRestOutput* output, + const char* url, + const OrthancPluginHttpRequest* request) +{ +} + + + +extern "C" +{ + ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) + { + context_ = context; + + /* Check the version of the Orthanc core */ + if (OrthancPluginCheckVersion(context_) == 0) + { + char info[1024]; + sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin", + context_->orthancVersion, + ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, + ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER, + ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER); + OrthancPluginLogError(context, info); + return -1; + } + + OrthancPluginSetDescription(context_, "Serve additional folders with the HTTP server of Orthanc."); + + return 0; + } + + + ORTHANC_PLUGINS_API void OrthancPluginFinalize() + { + } + + + ORTHANC_PLUGINS_API const char* OrthancPluginGetName() + { + return "serve-folders"; + } + + + ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion() + { + return "1.0"; + } +} diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/ServeFolders/VersionScript.map --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Samples/ServeFolders/VersionScript.map Fri Feb 13 13:28:01 2015 +0100 @@ -0,0 +1,12 @@ +# This is a version-script for Orthanc plugins + +{ +global: + OrthancPluginInitialize; + OrthancPluginFinalize; + OrthancPluginGetName; + OrthancPluginGetVersion; + +local: + *; +}; diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/StorageArea/CMakeLists.txt --- a/Plugins/Samples/StorageArea/CMakeLists.txt Fri Feb 13 09:51:22 2015 +0100 +++ b/Plugins/Samples/StorageArea/CMakeLists.txt Fri Feb 13 13:28:01 2015 +0100 @@ -7,7 +7,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror") endif() -include_directories(${CMAKE_SOURCE_DIR}/../../OrthancCPlugin/) +include_directories(${CMAKE_SOURCE_DIR}/../../Include/) add_library(PluginTest SHARED Plugin.cpp) if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") diff -r 0f9e0e808e0f -r f497a72d9f71 Plugins/Samples/WebSkeleton/CMakeLists.txt --- a/Plugins/Samples/WebSkeleton/CMakeLists.txt Fri Feb 13 09:51:22 2015 +0100 +++ b/Plugins/Samples/WebSkeleton/CMakeLists.txt Fri Feb 13 13:28:01 2015 +0100 @@ -7,7 +7,7 @@ include(Framework/Framework.cmake) -include_directories(${CMAKE_SOURCE_DIR}/../../OrthancCPlugin/) +include_directories(${CMAKE_SOURCE_DIR}/../../Include/) add_library(WebSkeleton SHARED ${AUTOGENERATED_SOURCES}