annotate MySQL/CMakeLists.txt @ 419:d468033284ef

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