# HG changeset patch # User Sebastien Jodogne # Date 1593585741 -7200 # Node ID d633e5bb7ba3b867709a1fb3ef0f927611b9f906 # Parent 1c89208fbba90e60f9251fb22e7ee009afd75171 reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project diff -r 1c89208fbba9 -r d633e5bb7ba3 LinuxCompilation.txt --- a/LinuxCompilation.txt Tue Jun 30 17:00:18 2020 +0200 +++ b/LinuxCompilation.txt Wed Jul 01 08:42:21 2020 +0200 @@ -84,6 +84,7 @@ libsqlite3-dev libssl-dev zlib1g-dev libdcmtk2-dev \ libboost-all-dev libwrap0-dev libjsoncpp-dev libpugixml-dev +# cd ./Build # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_CIVETWEB=OFF \ -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \ @@ -105,6 +106,7 @@ zlib1g-dev libdcmtk2-dev libboost-all-dev libwrap0-dev \ libcharls-dev libjsoncpp-dev libpugixml-dev +# cd ./Build # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \ -DUSE_SYSTEM_CIVETWEB=OFF \ @@ -125,6 +127,7 @@ zlib1g-dev libdcmtk-dev libboost-all-dev libwrap0-dev \ libcharls-dev libjsoncpp-dev libpugixml-dev tzdata +# cd ./Build # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \ -DUSE_SYSTEM_CIVETWEB=OFF \ @@ -137,6 +140,7 @@ NB: Instructions to use clang and ninja: # sudo apt-get install ninja-build +# cd ./Build # CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -G Ninja \ -DALLOW_DOWNLOADS=ON \ -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \ @@ -156,6 +160,7 @@ zlib1g-dev libdcmtk-dev libboost-all-dev libwrap0-dev \ libcharls-dev libjsoncpp-dev libpugixml-dev locales +# cd ./Build # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE=ON \ -DUSE_SYSTEM_CIVETWEB=OFF \ @@ -184,6 +189,7 @@ # sudo yum install gflags-devel +# cd ./Build # cmake "-DDCMTK_LIBRARIES=CharLS" \ -DENABLE_CIVETWEB=OFF \ -DSYSTEM_MONGOOSE_USE_CALLBACKS=OFF \ @@ -202,6 +208,7 @@ # pkg install jsoncpp pugixml lua51 curl googletest dcmtk cmake jpeg \ e2fsprogs-libuuid boost-libs sqlite3 python libiconv +# cd ./Build # cmake -DALLOW_DOWNLOADS=ON \ -DUSE_SYSTEM_CIVETWEB=OFF \ -DDCMTK_LIBRARIES="dcmdsig;charls;dcmjpls" \ diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/CMakeLists.txt --- a/OrthancServer/CMakeLists.txt Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/CMakeLists.txt Wed Jul 01 08:42:21 2020 +0200 @@ -271,6 +271,7 @@ add_definitions( -DORTHANC_BUILD_UNIT_TESTS=1 + -DORTHANC_BUILDING_SERVER_LIBRARY=1 # Macros for the plugins -DHAS_ORTHANC_EXCEPTION=0 diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/Plugins/Engine/PluginsEnumerations.h --- a/OrthancServer/Plugins/Engine/PluginsEnumerations.h Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/Plugins/Engine/PluginsEnumerations.h Wed Jul 01 08:42:21 2020 +0200 @@ -42,8 +42,9 @@ * "orthanc-databases" project. **/ +#include "../../Sources/Search/DatabaseConstraint.h" +#include "../../Sources/ServerEnumerations.h" #include "../Include/orthanc/OrthancCPlugin.h" -#include "../../Sources/Search/DatabaseConstraint.h" namespace Orthanc { diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/Sources/Search/DatabaseConstraint.cpp --- a/OrthancServer/Sources/Search/DatabaseConstraint.cpp Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.cpp Wed Jul 01 08:42:21 2020 +0200 @@ -31,11 +31,21 @@ **/ -#include "../PrecompiledHeadersServer.h" +#if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) +# error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined +#endif + +#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 +# include "../PrecompiledHeadersServer.h" +#endif + #include "DatabaseConstraint.h" -#include "../../../OrthancFramework/Sources/OrthancException.h" - +#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 +# include "../../../OrthancFramework/Sources/OrthancException.h" +#else +# include +#endif namespace Orthanc { diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/Sources/Search/DatabaseConstraint.h --- a/OrthancServer/Sources/Search/DatabaseConstraint.h Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.h Wed Jul 01 08:42:21 2020 +0200 @@ -33,8 +33,16 @@ #pragma once -#include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" -#include "../ServerEnumerations.h" +#if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) +# error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined +#endif + +#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 +# include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" +#else +// This is for the "orthanc-databases" project to reuse this file +# include +#endif #define ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT 0 @@ -50,6 +58,15 @@ namespace Orthanc { + enum ConstraintType + { + ConstraintType_Equal, + ConstraintType_SmallerOrEqual, + ConstraintType_GreaterOrEqual, + ConstraintType_Wildcard, + ConstraintType_List + }; + namespace Plugins { #if ORTHANC_ENABLE_PLUGINS == 1 diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/Sources/Search/ISqlLookupFormatter.cpp --- a/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Wed Jul 01 08:42:21 2020 +0200 @@ -31,10 +31,22 @@ **/ -#include "../PrecompiledHeadersServer.h" +#if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) +# error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined +#endif + +#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 +# include "../PrecompiledHeadersServer.h" +#endif + #include "ISqlLookupFormatter.h" -#include "../../../OrthancFramework/Sources/OrthancException.h" +#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 +# include "../../../OrthancFramework/Sources/OrthancException.h" +#else +# include +#endif + #include "DatabaseConstraint.h" namespace Orthanc diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/Sources/Search/ISqlLookupFormatter.h --- a/OrthancServer/Sources/Search/ISqlLookupFormatter.h Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.h Wed Jul 01 08:42:21 2020 +0200 @@ -33,7 +33,11 @@ #pragma once -#include "../../../OrthancFramework/Sources/Enumerations.h" +#if ORTHANC_BUILDING_SERVER_LIBRARY == 1 +# include "../../../OrthancFramework/Sources/Enumerations.h" +#else +# include +#endif #include #include diff -r 1c89208fbba9 -r d633e5bb7ba3 OrthancServer/Sources/ServerEnumerations.h --- a/OrthancServer/Sources/ServerEnumerations.h Tue Jun 30 17:00:18 2020 +0200 +++ b/OrthancServer/Sources/ServerEnumerations.h Wed Jul 01 08:42:21 2020 +0200 @@ -63,15 +63,6 @@ DicomTagType_Generic // Tag that is only stored in the JSON files }; - enum ConstraintType - { - ConstraintType_Equal, - ConstraintType_SmallerOrEqual, - ConstraintType_GreaterOrEqual, - ConstraintType_Wildcard, - ConstraintType_List - }; - namespace Compatibility { enum IdentifierConstraintType