Mercurial > hg > orthanc-databases
annotate Resources/CMake/DatabasesFrameworkConfiguration.cmake @ 267:ece4663dedde
Fix issue #193
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 21 Apr 2021 11:03:44 +0200 |
parents | 9d00e5e073e8 |
children | 64bf8914f02e |
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 | |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
172
diff
changeset
|
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium |
0 | 5 # |
6 # This program is free software: you can redistribute it and/or | |
7 # modify it under the terms of the GNU Affero General Public License | |
8 # as published by the Free Software Foundation, either version 3 of | |
9 # the License, or (at your option) any later version. | |
10 # | |
11 # This program is distributed in the hope that it will be useful, but | |
12 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 # Affero General Public License for more details. | |
15 # | |
16 # You should have received a copy of the GNU Affero General Public License | |
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | |
19 | |
20 | |
21 ##################################################################### | |
22 ## Enable the Orthanc subcomponents depending on the configuration | |
23 ##################################################################### | |
24 | |
25 if (ENABLE_SQLITE_BACKEND) | |
26 set(ENABLE_SQLITE ON) | |
27 endif() | |
28 | |
29 if (ENABLE_POSTGRESQL_BACKEND) | |
80
16df1a6ea452
Fix issue 105 (Unable to connect to PostgreSQL database using SSL)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
67
diff
changeset
|
30 set(ENABLE_CRYPTO_OPTIONS ON) |
0 | 31 set(ENABLE_ZLIB ON) |
83 | 32 |
33 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | |
34 set(ENABLE_OPENSSL_ENGINES ON) | |
35 endif() | |
0 | 36 endif() |
37 | |
38 if (ENABLE_MYSQL_BACKEND) | |
39 set(ENABLE_CRYPTO_OPTIONS ON) | |
40 set(ENABLE_SSL ON) | |
3 | 41 set(ENABLE_ZLIB ON) |
39 | 42 set(ENABLE_LOCALE ON) # iconv is needed |
43 set(ENABLE_WEB_CLIENT ON) # libcurl is needed | |
0 | 44 |
45 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | |
46 set(ENABLE_OPENSSL_ENGINES ON) | |
47 endif() | |
48 endif() | |
49 | |
50 | |
51 ##################################################################### | |
52 ## Configure the Orthanc Framework | |
53 ##################################################################### | |
54 | |
167 | 55 include_directories(${ORTHANC_FRAMEWORK_ROOT}) |
56 | |
156
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
57 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
58 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) |
54
b3de8c09c8b0
disable of Orthanc modules that are useless for databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
39
diff
changeset
|
59 |
156
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
60 if (ENABLE_SQLITE_BACKEND) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
61 add_definitions(-DORTHANC_ENABLE_SQLITE=1) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
62 endif() |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
63 |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
64 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
65 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
66 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
67 include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/GoogleTestConfiguration.cmake) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
68 |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
69 else() |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
70 # Those modules of the Orthanc framework are not needed when dealing |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
71 # with databases |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
72 set(ENABLE_MODULE_IMAGES OFF) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
73 set(ENABLE_MODULE_JOBS OFF) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
74 set(ENABLE_MODULE_DICOM OFF) |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
75 |
167 | 76 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake) |
156
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
77 endif() |
710537acb488
dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
78 |
0 | 79 |
80 | |
81 ##################################################################### | |
82 ## Common source files for the databases | |
83 ##################################################################### | |
84 | |
85 set(ORTHANC_DATABASES_ROOT ${CMAKE_CURRENT_LIST_DIR}/../..) | |
86 | |
87 set(DATABASES_SOURCES | |
88 ${ORTHANC_DATABASES_ROOT}/Framework/Common/BinaryStringValue.cpp | |
89 ${ORTHANC_DATABASES_ROOT}/Framework/Common/DatabaseManager.cpp | |
90 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Dictionary.cpp | |
91 ${ORTHANC_DATABASES_ROOT}/Framework/Common/GenericFormatter.cpp | |
23
b2ff1cd2907a
handling of implicit transactions in DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3
diff
changeset
|
92 ${ORTHANC_DATABASES_ROOT}/Framework/Common/ImplicitTransaction.cpp |
244
02cd7254c949
separating class InputFileValue from FileValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
226
diff
changeset
|
93 ${ORTHANC_DATABASES_ROOT}/Framework/Common/InputFileValue.cpp |
0 | 94 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Integer64Value.cpp |
95 ${ORTHANC_DATABASES_ROOT}/Framework/Common/NullValue.cpp | |
96 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Query.cpp | |
97 ${ORTHANC_DATABASES_ROOT}/Framework/Common/ResultBase.cpp | |
245
9d00e5e073e8
rename FileValue as ResultFileValue
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
244
diff
changeset
|
98 ${ORTHANC_DATABASES_ROOT}/Framework/Common/ResultFileValue.cpp |
226
a4918d57435c
DatabaseManager doesn't IDatabaseFactory anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
99 ${ORTHANC_DATABASES_ROOT}/Framework/Common/RetryDatabaseFactory.cpp |
a4918d57435c
DatabaseManager doesn't IDatabaseFactory anymore
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
193
diff
changeset
|
100 ${ORTHANC_DATABASES_ROOT}/Framework/Common/RetryDatabaseFactory.cpp |
0 | 101 ${ORTHANC_DATABASES_ROOT}/Framework/Common/StatementLocation.cpp |
102 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Utf8StringValue.cpp | |
103 ) | |
104 | |
105 | |
106 ##################################################################### | |
107 ## Configure SQLite if need be | |
108 ##################################################################### | |
109 | |
110 if (ENABLE_SQLITE_BACKEND) | |
111 list(APPEND DATABASES_SOURCES | |
112 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteDatabase.cpp | |
113 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteResult.cpp | |
114 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteStatement.cpp | |
115 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteTransaction.cpp | |
116 ) | |
117 endif() | |
118 | |
119 | |
120 ##################################################################### | |
121 ## Configure MySQL client (MariaDB) if need be | |
122 ##################################################################### | |
123 | |
124 if (ENABLE_MYSQL_BACKEND) | |
125 include(${CMAKE_CURRENT_LIST_DIR}/MariaDBConfiguration.cmake) | |
126 add_definitions(-DORTHANC_ENABLE_MYSQL=1) | |
127 list(APPEND DATABASES_SOURCES | |
128 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLDatabase.cpp | |
129 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLParameters.cpp | |
130 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLResult.cpp | |
131 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLStatement.cpp | |
132 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLTransaction.cpp | |
133 ${MYSQL_CLIENT_SOURCES} | |
134 ) | |
135 else() | |
136 unset(USE_SYSTEM_MYSQL_CLIENT CACHE) | |
137 add_definitions(-DORTHANC_ENABLE_MYSQL=0) | |
138 endif() | |
139 | |
140 | |
141 | |
142 ##################################################################### | |
143 ## Configure PostgreSQL client if need be | |
144 ##################################################################### | |
145 | |
146 if (ENABLE_POSTGRESQL_BACKEND) | |
147 include(${CMAKE_CURRENT_LIST_DIR}/PostgreSQLConfiguration.cmake) | |
148 add_definitions(-DORTHANC_ENABLE_POSTGRESQL=1) | |
149 list(APPEND DATABASES_SOURCES | |
150 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLDatabase.cpp | |
151 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLLargeObject.cpp | |
152 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLParameters.cpp | |
153 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLResult.cpp | |
154 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLStatement.cpp | |
155 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLTransaction.cpp | |
156 ${LIBPQ_SOURCES} | |
157 ) | |
158 else() | |
159 unset(USE_SYSTEM_LIBPQ CACHE) | |
160 add_definitions(-DORTHANC_ENABLE_POSTGRESQL=0) | |
161 endif() |