comparison MySQL/CMakeLists.txt @ 569:f18e46d7dbf8 attach-custom-data

merged find-refactoring -> attach-custom-data
author Alain Mazy <am@orthanc.team>
date Tue, 24 Sep 2024 15:04:21 +0200
parents cd9521e04249 9249064b675b
children
comparison
equal deleted inserted replaced
368:82f73188b58d 569:f18e46d7dbf8
1 # Orthanc - A Lightweight, RESTful DICOM Store 1 # Orthanc - A Lightweight, RESTful DICOM Store
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics 2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
3 # Department, University Hospital of Liege, Belgium 3 # Department, University Hospital of Liege, Belgium
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium 4 # Copyright (C) 2017-2023 Osimis S.A., Belgium
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
5 # 7 #
6 # This program is free software: you can redistribute it and/or 8 # This program is free software: you can redistribute it and/or
7 # modify it under the terms of the GNU Affero General Public License 9 # modify it under the terms of the GNU Affero General Public License
8 # as published by the Free Software Foundation, either version 3 of 10 # as published by the Free Software Foundation, either version 3 of
9 # the License, or (at your option) any later version. 11 # the License, or (at your option) any later version.
20 cmake_minimum_required(VERSION 2.8) 22 cmake_minimum_required(VERSION 2.8)
21 project(OrthancMySQL) 23 project(OrthancMySQL)
22 24
23 set(ORTHANC_PLUGIN_VERSION "mainline") 25 set(ORTHANC_PLUGIN_VERSION "mainline")
24 26
27 # This is the preferred version of the Orthanc SDK for this plugin
28 set(ORTHANC_SDK_DEFAULT_VERSION "1.12.0")
29
30 # This is the list of the versions of the Orthanc SDK against which
31 # this plugin will compile
32 set(ORTHANC_SDK_COMPATIBLE_VERSIONS "0.9.5" "1.4.0" "1.5.2" "1.5.4" "1.9.2" "1.12.0" "1.12.3" "1.12.4")
33
34 # This is the minimal version of the Orthanc runtime that will provide
35 # best performance. If the version of the Orthanc runtime is below
36 # this minimal version, a warning message will be printed (but the
37 # plugin will still start).
25 set(ORTHANC_OPTIMAL_VERSION_MAJOR 1) 38 set(ORTHANC_OPTIMAL_VERSION_MAJOR 1)
26 set(ORTHANC_OPTIMAL_VERSION_MINOR 9) 39 set(ORTHANC_OPTIMAL_VERSION_MINOR 12)
27 set(ORTHANC_OPTIMAL_VERSION_REVISION 2) 40 set(ORTHANC_OPTIMAL_VERSION_REVISION 0)
28 41
29 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") 42 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
30 set(ORTHANC_FRAMEWORK_VERSION "mainline") 43 set(ORTHANC_FRAMEWORK_VERSION "mainline")
31 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") 44 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
32 else() 45 else()
33 set(ORTHANC_FRAMEWORK_VERSION "1.9.6") 46 set(ORTHANC_FRAMEWORK_VERSION "1.12.4")
34 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") 47 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
35 endif() 48 endif()
36 49
37 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake) 50 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
38 51
39 set(ENABLE_MYSQL_BACKEND ON) 52 set(ENABLE_MYSQL_BACKEND ON)
40 set(OPENSSL_STATIC_VERSION "1.1.1" CACHE STRING "Force the use of OpenSSL 1.1.1" FORCE) 53 set(OPENSSL_STATIC_VERSION "3.0" CACHE STRING "Force the use of OpenSSL 3.0.x" FORCE)
41 54
42 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake) 55 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake)
43 56
44 57
45 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 58 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
76 89
77 EmbedResources( 90 EmbedResources(
78 MYSQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql 91 MYSQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql
79 MYSQL_GET_LAST_CHANGE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/GetLastChangeIndex.sql 92 MYSQL_GET_LAST_CHANGE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/GetLastChangeIndex.sql
80 MYSQL_CREATE_INSTANCE ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql 93 MYSQL_CREATE_INSTANCE ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql
81 94 MYSQL_INSTALL_REVISION_AND_CUSTOM_DATA ${CMAKE_SOURCE_DIR}/Plugins/InstallRevisionAndCustomData.sql
82 MYSQL_INSTALL_REVISION_AND_CUSTOM_DATA 95 MYSQL_DELETE_RESOURCES ${CMAKE_SOURCE_DIR}/Plugins/DeleteResources.sql
83 ${CMAKE_SOURCE_DIR}/Plugins/InstallRevisionAndCustomData.sql
84 ) 96 )
97
98 if (EXISTS ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto)
99 add_custom_command(
100 COMMAND
101 ${PROTOC_EXECUTABLE} ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto --cpp_out=${AUTOGENERATED_DIR} -I${ORTHANC_SDK_ROOT}/orthanc/
102 DEPENDS
103 ProtobufCompiler
104 ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto
105 OUTPUT
106 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc
107 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.h
108 )
109
110 list(APPEND AUTOGENERATED_SOURCES
111 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc
112 )
113 endif()
114
85 115
86 add_custom_target( 116 add_custom_target(
87 AutogeneratedTarget 117 AutogeneratedTarget
88 DEPENDS 118 DEPENDS
89 ${AUTOGENERATED_SOURCES} 119 ${AUTOGENERATED_SOURCES}
156 186
157 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) 187 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
158 set_target_properties(UnitTests PROPERTIES 188 set_target_properties(UnitTests PROPERTIES
159 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 189 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
160 ) 190 )
191
192 if (COMMAND DefineSourceBasenameForTarget)
193 DefineSourceBasenameForTarget(FrameworkForPlugins)
194 DefineSourceBasenameForTarget(OrthancMySQLIndex)
195 DefineSourceBasenameForTarget(OrthancMySQLStorage)
196 DefineSourceBasenameForTarget(UnitTests)
197 endif()