annotate MySQL/CMakeLists.txt @ 470:11c6bcc9d1f2

cleanup
author Alain Mazy <am@osimis.io>
date Mon, 05 Feb 2024 18:26:37 +0100
parents bba27bbef7e0
children e8b4bb6a33e7
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
459
ecd0b719cff5 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 442
diff changeset
4 # Copyright (C) 2017-2024 Osimis S.A., Belgium
ecd0b719cff5 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 442
diff changeset
5 # 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
6 #
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
7 # 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
8 # 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
9 # 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
10 # 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
11 #
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
12 # 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
13 # 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
14 # 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
15 # Affero General Public License for more details.
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
16 #
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
17 # 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
18 # 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
19
b5fb8b77ce4d initial commit of ODBC framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 328
diff changeset
20
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 cmake_minimum_required(VERSION 2.8)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 project(OrthancMySQL)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
413
afb30d17f090 back to mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 412
diff changeset
24 set(ORTHANC_PLUGIN_VERSION "mainline")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
462
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
26 set(ORTHANC_SDK_DEFAULT_VERSION "1.12.0")
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
27
129
534759b0cf14 use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 123
diff changeset
28 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
29 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
30 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
31
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 set(ORTHANC_FRAMEWORK_VERSION "mainline")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 else()
462
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
diff changeset
36 set(ORTHANC_FRAMEWORK_VERSION "1.12.3")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginParameters.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 set(ENABLE_MYSQL_BACKEND ON)
358
1280b40d6696 switch to OpenSSL 3.0.x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 329
diff changeset
43 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
44
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DatabasesPluginConfiguration.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
47
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
48 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
49 execute_process(
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
50 COMMAND
167
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
51 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/../Resources/WindowsResources.py
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
52 ${ORTHANC_PLUGIN_VERSION} "MySQL storage area plugin" OrthancMySQLStorage.dll
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
53 "MySQL as a database back-end to Orthanc (storage area)"
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
54 ERROR_VARIABLE Failure
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
55 OUTPUT_FILE ${AUTOGENERATED_DIR}/StorageVersion.rc
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
56 )
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 (Failure)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
59 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
60 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
61
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
62 execute_process(
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
63 COMMAND
167
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 155
diff changeset
64 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/../Resources/WindowsResources.py
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
65 ${ORTHANC_PLUGIN_VERSION} "MySQL index plugin" OrthancMySQLIndex.dll
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
66 "MySQL as a database back-end to Orthanc (index)"
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
67 ERROR_VARIABLE Failure
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
68 OUTPUT_FILE ${AUTOGENERATED_DIR}/IndexVersion.rc
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
69 )
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
70
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
71 if (Failure)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
72 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
73 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
74
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
75 set(INDEX_RESOURCES ${AUTOGENERATED_DIR}/IndexVersion.rc)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
76 set(STORAGE_RESOURCES ${AUTOGENERATED_DIR}/StorageVersion.rc)
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
77 endif()
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
78
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
79
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 EmbedResources(
87
48d445f756db new extension implemented for MySQL: GetLastChangeIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 69
diff changeset
81 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
82 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
83 MYSQL_CREATE_INSTANCE ${CMAKE_SOURCE_DIR}/Plugins/CreateInstance.sql
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
372
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
86 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
87 add_custom_command(
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
88 COMMAND
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
89 ${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
90 DEPENDS
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
91 ProtobufCompiler
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
92 ${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
93 OUTPUT
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
94 ${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
95 ${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
96 )
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
97
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
98 list(APPEND AUTOGENERATED_SOURCES
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
99 ${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
100 )
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
101 endif()
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
102
b5e2c1e48828 created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 359
diff changeset
103
155
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
104 add_custom_target(
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
105 AutogeneratedTarget
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
106 DEPENDS
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
107 ${AUTOGENERATED_SOURCES}
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
108 )
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
109
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
110 add_library(FrameworkForPlugins STATIC
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
111 ${AUTOGENERATED_SOURCES}
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
112 ${DATABASES_SOURCES}
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
113 ${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
114 Plugins/MySQLIndex.cpp
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
115 Plugins/MySQLStorageArea.cpp
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
116 )
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
117
316
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
118 set_target_properties(FrameworkForPlugins PROPERTIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
119 POSITION_INDEPENDENT_CODE ON
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 315
diff changeset
120 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
121 )
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
122
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 add_library(OrthancMySQLIndex SHARED
38
bc979149e138 dll versioning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 27
diff changeset
124 ${INDEX_RESOURCES}
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 17
diff changeset
125 Plugins/IndexPlugin.cpp
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
126 )
24
17f849b2af34 sharing plugin initialization code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 17
diff changeset
127
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
128 add_library(OrthancMySQLStorage SHARED
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
129 ${STORAGE_RESOURCES}
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
130 Plugins/StoragePlugin.cpp
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
318
4a4087a79b9b fix dependencies between targets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 317
diff changeset
133 add_dependencies(FrameworkForPlugins AutogeneratedTarget)
4a4087a79b9b fix dependencies between targets
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 317
diff changeset
134
315
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
135 target_link_libraries(OrthancMySQLIndex FrameworkForPlugins)
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
136 target_link_libraries(OrthancMySQLStorage FrameworkForPlugins)
11641063ddb2 speed up compilation by sharing library between plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 301
diff changeset
137
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 message("Setting the version of the libraries to ${ORTHANC_PLUGIN_VERSION}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 add_definitions(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 -DORTHANC_PLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
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
2
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
144 set_target_properties(OrthancMySQLStorage PROPERTIES
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
145 VERSION ${ORTHANC_PLUGIN_VERSION}
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
146 SOVERSION ${ORTHANC_PLUGIN_VERSION}
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
147 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
148 )
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 set_target_properties(OrthancMySQLIndex PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 VERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 SOVERSION ${ORTHANC_PLUGIN_VERSION}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=1
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 install(
2
17bce6a07b2b storage plugin skeletons
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
157 TARGETS OrthancMySQLIndex OrthancMySQLStorage
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 RUNTIME DESTINATION lib # Destination for Windows
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
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
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 add_executable(UnitTests
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 Plugins/MySQLIndex.cpp
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
165 Plugins/MySQLStorageArea.cpp
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 UnitTests/UnitTestsMain.cpp
17
54ea251aed70 unit test
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2
diff changeset
167
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 ${DATABASES_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 ${GOOGLE_TEST_SOURCES}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 ${AUTOGENERATED_SOURCES}
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
155
23cf7def8e44 use of OrthancPluginsExports.cmake, avoid race conditions with EmbedResources.py
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
173 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
174
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 target_link_libraries(UnitTests ${GOOGLE_TEST_LIBRARIES})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 set_target_properties(UnitTests PROPERTIES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 COMPILE_FLAGS -DORTHANC_ENABLE_LOGGING_PLUGIN=0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 )
441
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
179
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
180 if (COMMAND DefineSourceBasenameForTarget)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
181 DefineSourceBasenameForTarget(FrameworkForPlugins)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
182 DefineSourceBasenameForTarget(OrthancMySQLIndex)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
183 DefineSourceBasenameForTarget(OrthancMySQLStorage)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
184 DefineSourceBasenameForTarget(UnitTests)
2b797871eff6 handling of DefineSourceBasenameForTarget for MySQL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 425
diff changeset
185 endif()