comparison PostgreSQL/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 a8f9d44e7842
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(OrthancPostgreSQL) 23 project(OrthancPostgreSQL)
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.3")
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 "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 3)
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 set(ENABLE_SSL ON) 50 set(ENABLE_SSL ON)
38 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake) 51 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
39 52
40 set(ENABLE_POSTGRESQL_BACKEND ON) 53 set(ENABLE_POSTGRESQL_BACKEND ON)
41 set(OPENSSL_STATIC_VERSION "1.1.1" CACHE STRING "Force the use of OpenSSL 1.1.1" FORCE) 54 set(OPENSSL_STATIC_VERSION "3.0" CACHE STRING "Force the use of OpenSSL 3.0.x" FORCE)
42 55
43 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake) 56 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake)
44 57
45 58
46 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 59 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
74 set(STORAGE_RESOURCES ${AUTOGENERATED_DIR}/StorageVersion.rc) 87 set(STORAGE_RESOURCES ${AUTOGENERATED_DIR}/StorageVersion.rc)
75 endif() 88 endif()
76 89
77 90
78 EmbedResources( 91 EmbedResources(
79 POSTGRESQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql 92 POSTGRESQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/SQL/PrepareIndex.sql
80 POSTGRESQL_CREATE_INSTANCE ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql 93 POSTGRESQL_UPGRADE_UNKNOWN_TO_REV1 ${CMAKE_SOURCE_DIR}/Plugins/SQL/Upgrades/UnknownToRev1.sql
81 POSTGRESQL_FAST_TOTAL_SIZE ${CMAKE_SOURCE_DIR}/Plugins/FastTotalSize.sql 94 POSTGRESQL_UPGRADE_REV1_TO_REV2 ${CMAKE_SOURCE_DIR}/Plugins/SQL/Upgrades/Rev1ToRev2.sql
82 POSTGRESQL_FAST_COUNT_RESOURCES ${CMAKE_SOURCE_DIR}/Plugins/FastCountResources.sql 95 POSTGRESQL_UPGRADE_REV2_TO_REV3 ${CMAKE_SOURCE_DIR}/Plugins/SQL/Upgrades/Rev2ToRev3.sql
83 POSTGRESQL_GET_LAST_CHANGE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/GetLastChangeIndex.sql
84 ) 96 )
97
98
99 if (EXISTS ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto)
100 add_custom_command(
101 COMMAND
102 ${PROTOC_EXECUTABLE} ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto --cpp_out=${AUTOGENERATED_DIR} -I${ORTHANC_SDK_ROOT}/orthanc/
103 DEPENDS
104 ProtobufCompiler
105 ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto
106 OUTPUT
107 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc
108 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.h
109 )
110
111 list(APPEND AUTOGENERATED_SOURCES
112 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc
113 )
114 endif()
115
85 116
86 add_custom_target( 117 add_custom_target(
87 AutogeneratedTarget 118 AutogeneratedTarget
88 DEPENDS 119 DEPENDS
89 ${AUTOGENERATED_SOURCES} 120 ${AUTOGENERATED_SOURCES}
133 VERSION ${ORTHANC_PLUGIN_VERSION} 164 VERSION ${ORTHANC_PLUGIN_VERSION}
134 SOVERSION ${ORTHANC_PLUGIN_VERSION} 165 SOVERSION ${ORTHANC_PLUGIN_VERSION}
135 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1 166 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
136 ) 167 )
137 168
169
138 install( 170 install(
139 TARGETS OrthancPostgreSQLIndex OrthancPostgreSQLStorage 171 TARGETS OrthancPostgreSQLIndex OrthancPostgreSQLStorage
140 RUNTIME DESTINATION lib # Destination for Windows 172 RUNTIME DESTINATION lib # Destination for Windows
141 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux 173 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
142 ) 174 )
156 188
157 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES}) 189 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
158 set_target_properties(UnitTests PROPERTIES 190 set_target_properties(UnitTests PROPERTIES
159 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0 191 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
160 ) 192 )
193
194 if (COMMAND DefineSourceBasenameForTarget)
195 DefineSourceBasenameForTarget(FrameworkForPlugins)
196 DefineSourceBasenameForTarget(OrthancPostgreSQLIndex)
197 DefineSourceBasenameForTarget(OrthancPostgreSQLStorage)
198 DefineSourceBasenameForTarget(UnitTests)
199 endif()