annotate MySQL/CMakeLists.txt @ 524:48aba35fe64e large-queries

merged BEGIN and SET TRANSACTION statements
author Alain Mazy <am@orthanc.team>
date Tue, 09 Jul 2024 16:30:52 +0200
parents 586b80ea397c
children e1d3da372805
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
329
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
1 # Orthanc - A Lightweight, RESTful DICOM Store
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
3 # Department, University Hospital of Liege, Belgium
507
54d518dcd74a updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 503
diff changeset
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium
54d518dcd74a updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 503
diff changeset
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
459
ecd0b719cff5 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 442
diff changeset
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
329
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
7 #
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
8 # This program is free software: you can redistribute it and/or
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
9 # modify it under the terms of the GNU Affero General Public License
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
10 # as published by the Free Software Foundation, either version 3 of
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
11 # the License, or (at your option) any later version.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
12 #
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
13 # This program is distributed in the hope that it will be useful, but
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
16 # Affero General Public License for more details.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
17 #
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
20
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
21
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 cmake_minimum_required(VERSION 2.8)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 project(OrthancMySQL)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
513
dd6359e75825 back to mainline
Alain Mazy <am@orthanc.team>
parents: 512
diff changeset
25 set(ORTHANC_PLUGIN_VERSION "mainline")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
489
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
27 # This is the preferred version of the Orthanc SDK for this plugin
519
586b80ea397c back to previous default SDK since 1.12.4 is not required for plugin name logging
Alain Mazy <am@orthanc.team>
parents: 513
diff changeset
28 set(ORTHANC_SDK_DEFAULT_VERSION "1.12.0")
462
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
29
489
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
30 # This is the list of the versions of the Orthanc SDK against which
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
31 # this plugin will compile
511
51a78b3f96bb use Framework 1.12.4 by default
Alain Mazy <am@orthanc.team>
parents: 507
diff changeset
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")
489
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
33
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
34 # This is the minimal version of the Orthanc runtime that will provide
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
35 # best performance. If the version of the Orthanc runtime is below
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
36 # this minimal version, a warning message will be printed (but the
e8b4bb6a33e7 introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 462
diff changeset
37 # plugin will still start).
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 123
diff changeset
38 set(ORTHANC_OPTIMAL_VERSION_MAJOR 1)
372
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
39 set(ORTHANC_OPTIMAL_VERSION_MINOR 12)
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
40 set(ORTHANC_OPTIMAL_VERSION_REVISION 0)
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 123
diff changeset
41
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 set(ORTHANC_FRAMEWORK_VERSION "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 else()
511
51a78b3f96bb use Framework 1.12.4 by default
Alain Mazy <am@orthanc.team>
parents: 507
diff changeset
46 set(ORTHANC_FRAMEWORK_VERSION "1.12.4")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 set(ENABLE_MYSQL_BACKEND ON)
358
1280b40d6696 switch to OpenSSL 3.0.x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 329
diff changeset
53 set(OPENSSL_STATIC_VERSION "3.0" CACHE STRING "Force the use of OpenSSL 3.0.x" FORCE)
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
57
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
58 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
59 execute_process(
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
60 COMMAND
167
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
61 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/../Resources/WindowsResources.py
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
62 ${ORTHANC_PLUGIN_VERSION} "MySQL storage area plugin" OrthancMySQLStorage.dll
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
63 "MySQL as a database back-end to Orthanc (storage area)"
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
64 ERROR_VARIABLE Failure
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
65 OUTPUT_FILE ${AUTOGENERATED_DIR}/StorageVersion.rc
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
66 )
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
67
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
68 if (Failure)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
69 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
70 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
71
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
72 execute_process(
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
73 COMMAND
167
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
74 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/../Resources/WindowsResources.py
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
75 ${ORTHANC_PLUGIN_VERSION} "MySQL index plugin" OrthancMySQLIndex.dll
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
76 "MySQL as a database back-end to Orthanc (index)"
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
77 ERROR_VARIABLE Failure
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
78 OUTPUT_FILE ${AUTOGENERATED_DIR}/IndexVersion.rc
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
79 )
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
80
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
81 if (Failure)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
82 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
83 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
84
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
85 set(INDEX_RESOURCES ${AUTOGENERATED_DIR}/IndexVersion.rc)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
86 set(STORAGE_RESOURCES ${AUTOGENERATED_DIR}/StorageVersion.rc)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
87 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
88
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
89
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 EmbedResources(
87
48d445f756db new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 69
diff changeset
91 MYSQL_PREPARE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/PrepareIndex.sql
48d445f756db new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 69
diff changeset
92 MYSQL_GET_LAST_CHANGE_INDEX ${CMAKE_SOURCE_DIR}/Plugins/GetLastChangeIndex.sql
110
441a472bfd93 new extension implemented for MySQL: CreateInstance
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 93
diff changeset
93 MYSQL_CREATE_INSTANCE ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql
424
95c413106a66 Introduced a procedure to delete resources (to be tested)
Alain Mazy <am@osimis.io>
parents: 413
diff changeset
94 MYSQL_DELETE_RESOURCES ${CMAKE_SOURCE_DIR}/Plugins/DeleteResources.sql
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
372
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
97 if (EXISTS ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto)
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
98 add_custom_command(
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
99 COMMAND
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
100 ${PROTOC_EXECUTABLE} ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto --cpp_out=${AUTOGENERATED_DIR} -I${ORTHANC_SDK_ROOT}/orthanc/
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
101 DEPENDS
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
102 ProtobufCompiler
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
103 ${ORTHANC_SDK_ROOT}/orthanc/OrthancDatabasePlugin.proto
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
104 OUTPUT
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
105 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
106 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.h
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
107 )
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
108
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
109 list(APPEND AUTOGENERATED_SOURCES
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
110 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
111 )
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
112 endif()
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
113
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
114
155
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
115 add_custom_target(
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
116 AutogeneratedTarget
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
117 DEPENDS
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
118 ${AUTOGENERATED_SOURCES}
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
119 )
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
120
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
121 add_library(FrameworkForPlugins STATIC
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
122 ${AUTOGENERATED_SOURCES}
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
123 ${DATABASES_SOURCES}
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
124 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/PluginInitialization.cpp
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
125 Plugins/MySQLIndex.cpp
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
126 Plugins/MySQLStorageArea.cpp
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
127 )
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
128
316
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
129 set_target_properties(FrameworkForPlugins PROPERTIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
130 POSITION_INDEPENDENT_CODE ON
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
131 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
132 )
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
133
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 add_library(OrthancMySQLIndex SHARED
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
135 ${INDEX_RESOURCES}
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 17
diff changeset
136 Plugins/IndexPlugin.cpp
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
137 )
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 17
diff changeset
138
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
139 add_library(OrthancMySQLStorage SHARED
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
140 ${STORAGE_RESOURCES}
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
141 Plugins/StoragePlugin.cpp
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
318
4a4087a79b9b fix dependencies between targets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 317
diff changeset
144 add_dependencies(FrameworkForPlugins AutogeneratedTarget)
4a4087a79b9b fix dependencies between targets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 317
diff changeset
145
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
146 target_link_libraries(OrthancMySQLIndex FrameworkForPlugins)
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
147 target_link_libraries(OrthancMySQLStorage FrameworkForPlugins)
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
148
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 add_definitions(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
2
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
155 set_target_properties(OrthancMySQLStorage PROPERTIES
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
156 VERSION ${ORTHANC_PLUGIN_VERSION}
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
157 SOVERSION ${ORTHANC_PLUGIN_VERSION}
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
158 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
159 )
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 set_target_properties(OrthancMySQLIndex PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 VERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 SOVERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 install(
2
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
168 TARGETS OrthancMySQLIndex OrthancMySQLStorage
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 RUNTIME DESTINATION lib # Destination for Windows
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 add_executable(UnitTests
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 Plugins/MySQLIndex.cpp
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
176 Plugins/MySQLStorageArea.cpp
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 UnitTests/UnitTestsMain.cpp
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
178
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 ${GOOGLE_TEST_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 ${AUTOGENERATED_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
155
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
184 add_dependencies(UnitTests AutogeneratedTarget)
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
185
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 set_target_properties(UnitTests PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 )
441
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
190
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
191 if (COMMAND DefineSourceBasenameForTarget)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
192 DefineSourceBasenameForTarget(FrameworkForPlugins)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
193 DefineSourceBasenameForTarget(OrthancMySQLIndex)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
194 DefineSourceBasenameForTarget(OrthancMySQLStorage)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
195 DefineSourceBasenameForTarget(UnitTests)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
196 endif()