# HG changeset patch # User Sebastien Jodogne # Date 1680686050 -7200 # Node ID 6aa19614ca20d6ac2807653f2d80b3a788956f21 # Parent 0fed785e974e61d315717e5f66fd813c95acf980 implemented protobuf for odbc diff -r 0fed785e974e -r 6aa19614ca20 Odbc/CMakeLists.txt --- a/Odbc/CMakeLists.txt Mon Apr 03 17:11:24 2023 +0200 +++ b/Odbc/CMakeLists.txt Wed Apr 05 11:14:10 2023 +0200 @@ -24,14 +24,14 @@ set(ORTHANC_PLUGIN_VERSION "mainline") set(ORTHANC_OPTIMAL_VERSION_MAJOR 1) -set(ORTHANC_OPTIMAL_VERSION_MINOR 9) -set(ORTHANC_OPTIMAL_VERSION_REVISION 2) +set(ORTHANC_OPTIMAL_VERSION_MINOR 12) +set(ORTHANC_OPTIMAL_VERSION_REVISION 0) if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") set(ORTHANC_FRAMEWORK_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_VERSION "1.9.6") + set(ORTHANC_FRAMEWORK_VERSION "1.12.0") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() @@ -79,6 +79,23 @@ ODBC_PREPARE_STORAGE ${CMAKE_SOURCE_DIR}/Plugins/PrepareStorage.sql ) +if (EXISTS ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto) + add_custom_command( + COMMAND + ${PROTOC_EXECUTABLE} ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto --cpp_out=${AUTOGENERATED_DIR} -I${ORTHANC_SDK_ROOT}/orthanc/ + DEPENDS + ProtobufCompiler + ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto + OUTPUT + ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc + ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.h + ) + + list(APPEND AUTOGENERATED_SOURCES + ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc + ) +endif() + add_custom_target( AutogeneratedTarget DEPENDS diff -r 0fed785e974e -r 6aa19614ca20 Odbc/NEWS --- a/Odbc/NEWS Mon Apr 03 17:11:24 2023 +0200 +++ b/Odbc/NEWS Wed Apr 05 11:14:10 2023 +0200 @@ -1,6 +1,9 @@ Pending changes in the mainline =============================== +* Compatibility with Orthanc SDK 1.12.0 (communications between the + Orthanc core and the database plugin using Google Protocol Buffers) + Release 1.1 (2021-12-06) ======================== diff -r 0fed785e974e -r 6aa19614ca20 Odbc/Plugins/IndexPlugin.cpp --- a/Odbc/Plugins/IndexPlugin.cpp Mon Apr 03 17:11:24 2023 +0200 +++ b/Odbc/Plugins/IndexPlugin.cpp Wed Apr 05 11:14:10 2023 +0200 @@ -42,6 +42,9 @@ #endif +#include + + static const char* const KEY_ODBC = "Odbc"; @@ -54,6 +57,8 @@ ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { + GOOGLE_PROTOBUF_VERIFY_VERSION; + if (!OrthancDatabases::InitializePlugin(context, "ODBC", true)) { return -1; @@ -130,6 +135,7 @@ { LOG(WARNING) << "ODBC index is finalizing"; OrthancDatabases::IndexBackend::Finalize(); + google::protobuf::ShutdownProtobufLibrary(); }