Mercurial > hg > orthanc-databases
annotate Resources/CMake/DatabasesPluginConfiguration.cmake @ 583:ae7375d38607 find-refactoring tip
MySQL: fix ordering
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Mon, 21 Oct 2024 18:19:51 +0200 |
parents | 9ed9a91bde33 |
children | f18e46d7dbf8 |
rev | line source |
---|---|
0 | 1 # Orthanc - A Lightweight, RESTful DICOM Store |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
3 # Department, University Hospital of Liege, Belgium | |
507
54d518dcd74a
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
489
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:
489
diff
changeset
|
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
459
ecd0b719cff5
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 7 # |
8 # This program is free software: you can redistribute it and/or | |
9 # modify it under the terms of the GNU Affero General Public License | |
10 # as published by the Free Software Foundation, either version 3 of | |
11 # the License, or (at your option) any later version. | |
12 # | |
13 # This program is distributed in the hope that it will be useful, but | |
14 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 # Affero General Public License for more details. | |
17 # | |
18 # You should have received a copy of the GNU Affero General Public License | |
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | |
21 | |
22 | |
300
a116dbdf9118
replaced CMAKE_SOURCE_DIR by CMAKE_CURRENT_LIST_DIR in CMake scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
272
diff
changeset
|
23 include(${CMAKE_CURRENT_LIST_DIR}/DatabasesFrameworkConfiguration.cmake) |
a116dbdf9118
replaced CMAKE_SOURCE_DIR by CMAKE_CURRENT_LIST_DIR in CMake scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
272
diff
changeset
|
24 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/CMake/AutoGeneratedCode.cmake) |
a116dbdf9118
replaced CMAKE_SOURCE_DIR by CMAKE_CURRENT_LIST_DIR in CMake scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
272
diff
changeset
|
25 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/Plugins/OrthancPluginsExports.cmake) |
0 | 26 |
27 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) | |
489
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
28 if (NOT ORTHANC_SDK_VERSION STREQUAL "framework") |
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
29 list(FIND ORTHANC_SDK_COMPATIBLE_VERSIONS ${ORTHANC_SDK_VERSION} tmp) |
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
30 if (tmp EQUAL -1) |
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
31 message(FATAL_ERROR "This database plugin is not compatible with Orthanc SDK ${ORTHANC_SDK_VERSION}") |
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
32 endif() |
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
33 endif() |
e8b4bb6a33e7
introduction of ORTHANC_SDK_COMPATIBLE_VERSIONS in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
462
diff
changeset
|
34 |
0 | 35 if (ORTHANC_SDK_VERSION STREQUAL "0.9.5") |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
36 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-0.9.5) |
28
c0cb5d2cd696
checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1
diff
changeset
|
37 elseif (ORTHANC_SDK_VERSION STREQUAL "1.4.0") |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
38 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.4.0) |
94
badc89b06477
upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
69
diff
changeset
|
39 elseif (ORTHANC_SDK_VERSION STREQUAL "1.5.2") |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
40 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.5.2) |
123
121ab36c87bd
updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
94
diff
changeset
|
41 elseif (ORTHANC_SDK_VERSION STREQUAL "1.5.4") |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
42 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.5.4) |
272
c7dc70a0a477
upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
237
diff
changeset
|
43 elseif (ORTHANC_SDK_VERSION STREQUAL "1.9.2") |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
44 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.9.2) |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
45 elseif (ORTHANC_SDK_VERSION STREQUAL "1.12.0") |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
46 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.12.0) |
462
bba27bbef7e0
use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
459
diff
changeset
|
47 elseif (ORTHANC_SDK_VERSION STREQUAL "1.12.3") |
bba27bbef7e0
use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
459
diff
changeset
|
48 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.12.3) |
514 | 49 elseif (ORTHANC_SDK_VERSION STREQUAL "1.12.4") |
515 | 50 set(ORTHANC_SDK_ROOT ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Sdk-1.12.4) |
197
a57ca58c538a
CMake option "ORTHANC_SDK_VERSION" can be set to "framework" for developers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
51 elseif (ORTHANC_SDK_VERSION STREQUAL "framework") |
a57ca58c538a
CMake option "ORTHANC_SDK_VERSION" can be set to "framework" for developers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
52 set(tmp ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include/) |
a57ca58c538a
CMake option "ORTHANC_SDK_VERSION" can be set to "framework" for developers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
53 message(${tmp}) |
a57ca58c538a
CMake option "ORTHANC_SDK_VERSION" can be set to "framework" for developers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
54 if (NOT EXISTS ${tmp}/orthanc/OrthancCDatabasePlugin.h) |
a57ca58c538a
CMake option "ORTHANC_SDK_VERSION" can be set to "framework" for developers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
55 message(FATAL_ERROR "Your copy of the Orthanc framework doesn't contain the Orthanc plugin SDK") |
a57ca58c538a
CMake option "ORTHANC_SDK_VERSION" can be set to "framework" for developers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
194
diff
changeset
|
56 endif() |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
57 set(ORTHANC_SDK_ROOT ${tmp}) |
0 | 58 else() |
59 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}") | |
60 endif() | |
61 else () | |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
62 find_path(ORTHANC_SDK_ROOT orthanc/OrthancCDatabasePlugin.h |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
63 /usr/include |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
64 /usr/local/include |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
65 ) |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
66 |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
67 if (NOT ORTHANC_SDK_ROOT) |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
68 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
69 endif() |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
70 |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
71 check_include_file(${ORTHANC_SDK_ROOT}/orthanc/OrthancCDatabasePlugin.h HAVE_ORTHANC_H) |
0 | 72 if (NOT HAVE_ORTHANC_H) |
73 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") | |
74 endif() | |
75 endif() | |
76 | |
372
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
77 include_directories(${ORTHANC_SDK_ROOT}) |
b5e2c1e48828
created branch db-protobuf to take advantage of OrthancPluginRegisterDatabaseBackendV4()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
359
diff
changeset
|
78 |
0 | 79 |
129
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
80 if (NOT DEFINED ORTHANC_OPTIMAL_VERSION_MAJOR) |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
81 message(FATAL_ERROR "ORTHANC_OPTIMAL_VERSION_MAJOR is not defined") |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
82 endif() |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
83 |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
84 if (NOT DEFINED ORTHANC_OPTIMAL_VERSION_MINOR) |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
85 message(FATAL_ERROR "ORTHANC_OPTIMAL_VERSION_MINOR is not defined") |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
86 endif() |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
87 |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
88 if (NOT DEFINED ORTHANC_OPTIMAL_VERSION_REVISION) |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
89 message(FATAL_ERROR "ORTHANC_OPTIMAL_VERSION_REVISION is not defined") |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
90 endif() |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
91 |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
92 |
69
19764fc60ade
compatibility with Orthanc SDDK 0.9.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
68
diff
changeset
|
93 add_definitions( |
19764fc60ade
compatibility with Orthanc SDDK 0.9.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
68
diff
changeset
|
94 -DHAS_ORTHANC_EXCEPTION=1 |
129
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
95 -DORTHANC_OPTIMAL_VERSION_MAJOR=${ORTHANC_OPTIMAL_VERSION_MAJOR} |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
96 -DORTHANC_OPTIMAL_VERSION_MINOR=${ORTHANC_OPTIMAL_VERSION_MINOR} |
534759b0cf14
use of macros to report performance warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
123
diff
changeset
|
97 -DORTHANC_OPTIMAL_VERSION_REVISION=${ORTHANC_OPTIMAL_VERSION_REVISION} |
69
19764fc60ade
compatibility with Orthanc SDDK 0.9.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
68
diff
changeset
|
98 ) |
19764fc60ade
compatibility with Orthanc SDDK 0.9.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
68
diff
changeset
|
99 |
19764fc60ade
compatibility with Orthanc SDDK 0.9.5
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
68
diff
changeset
|
100 |
394 | 101 if ((STATIC_BUILD OR NOT USE_SYSTEM_PROTOBUF) AND |
102 CMAKE_SYSTEM_VERSION STREQUAL "LinuxStandardBase") | |
392 | 103 # This is necessary, at least on LSB (Linux Standard Base), |
104 # otherwise the following error is generated: "undefined reference | |
105 # to `__tls_get_addr'" | |
106 add_definitions(-DGOOGLE_PROTOBUF_NO_THREADLOCAL=1) | |
107 endif() | |
108 | |
109 | |
0 | 110 list(APPEND DATABASES_SOURCES |
111 ${ORTHANC_CORE_SOURCES} | |
205
873e37048f96
renaming OrthancCppDatabasePlugin.h as DatabaseBackendAdapterV2.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
112 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/DatabaseBackendAdapterV2.cpp |
212 | 113 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/DatabaseBackendAdapterV3.cpp |
373
be7de633695c
started DatabaseBackendAdapterV4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
372
diff
changeset
|
114 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/DatabaseBackendAdapterV4.cpp |
547
b8e6e7a19424
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
520
diff
changeset
|
115 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/DatabaseConstraint.cpp |
b8e6e7a19424
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
520
diff
changeset
|
116 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/ISqlLookupFormatter.cpp |
0 | 117 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/IndexBackend.cpp |
374
4a3985088723
moved class IndexConnectionsPool out of DatabaseBackendAdapterV3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
373
diff
changeset
|
118 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/IndexConnectionsPool.cpp |
550
9ed9a91bde33
un-sharing DatabaseConstraint and ISqlLookupFormatter with Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
549
diff
changeset
|
119 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/MessagesToolbox.cpp |
1
d17b2631bb67
starting StorageBackend
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
120 ${ORTHANC_DATABASES_ROOT}/Framework/Plugins/StorageBackend.cpp |
152 | 121 ${ORTHANC_DATABASES_ROOT}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp |
0 | 122 ) |