Mercurial > hg > orthanc-databases
annotate Resources/CMake/DatabasesFrameworkConfiguration.cmake @ 41:f729a4b6f37a OrthancMySQL-1.0
OrthancMySQL-1.0
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Jul 2018 08:28:13 +0200 |
parents | a9b8375099f6 |
children | b3de8c09c8b0 |
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 | |
4 # Copyright (C) 2017-2018 Osimis S.A., Belgium | |
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) | |
30 set(ENABLE_SSL ON) | |
31 set(ENABLE_ZLIB ON) | |
32 endif() | |
33 | |
34 if (ENABLE_MYSQL_BACKEND) | |
35 set(ENABLE_CRYPTO_OPTIONS ON) | |
36 set(ENABLE_SSL ON) | |
3 | 37 set(ENABLE_ZLIB ON) |
39 | 38 set(ENABLE_LOCALE ON) # iconv is needed |
39 set(ENABLE_WEB_CLIENT ON) # libcurl is needed | |
0 | 40 |
41 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") | |
42 set(ENABLE_OPENSSL_ENGINES ON) | |
43 endif() | |
44 endif() | |
45 | |
46 | |
47 ##################################################################### | |
48 ## Configure the Orthanc Framework | |
49 ##################################################################### | |
50 | |
51 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) | |
52 include_directories(${ORTHANC_ROOT}) | |
53 | |
54 | |
55 ##################################################################### | |
56 ## Common source files for the databases | |
57 ##################################################################### | |
58 | |
59 set(ORTHANC_DATABASES_ROOT ${CMAKE_CURRENT_LIST_DIR}/../..) | |
60 | |
61 set(DATABASES_SOURCES | |
62 ${ORTHANC_DATABASES_ROOT}/Framework/Common/BinaryStringValue.cpp | |
63 ${ORTHANC_DATABASES_ROOT}/Framework/Common/DatabaseManager.cpp | |
64 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Dictionary.cpp | |
65 ${ORTHANC_DATABASES_ROOT}/Framework/Common/FileValue.cpp | |
66 ${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
|
67 ${ORTHANC_DATABASES_ROOT}/Framework/Common/ImplicitTransaction.cpp |
0 | 68 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Integer64Value.cpp |
69 ${ORTHANC_DATABASES_ROOT}/Framework/Common/NullValue.cpp | |
70 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Query.cpp | |
71 ${ORTHANC_DATABASES_ROOT}/Framework/Common/ResultBase.cpp | |
72 ${ORTHANC_DATABASES_ROOT}/Framework/Common/StatementLocation.cpp | |
73 ${ORTHANC_DATABASES_ROOT}/Framework/Common/Utf8StringValue.cpp | |
74 ) | |
75 | |
76 | |
77 ##################################################################### | |
78 ## Configure SQLite if need be | |
79 ##################################################################### | |
80 | |
81 if (ENABLE_SQLITE_BACKEND) | |
82 list(APPEND DATABASES_SOURCES | |
83 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteDatabase.cpp | |
84 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteResult.cpp | |
85 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteStatement.cpp | |
86 ${ORTHANC_DATABASES_ROOT}/Framework/SQLite/SQLiteTransaction.cpp | |
87 ) | |
88 endif() | |
89 | |
90 | |
91 ##################################################################### | |
92 ## Configure MySQL client (MariaDB) if need be | |
93 ##################################################################### | |
94 | |
95 if (ENABLE_MYSQL_BACKEND) | |
96 include(${CMAKE_CURRENT_LIST_DIR}/MariaDBConfiguration.cmake) | |
97 add_definitions(-DORTHANC_ENABLE_MYSQL=1) | |
98 list(APPEND DATABASES_SOURCES | |
99 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLDatabase.cpp | |
100 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLParameters.cpp | |
101 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLResult.cpp | |
102 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLStatement.cpp | |
103 ${ORTHANC_DATABASES_ROOT}/Framework/MySQL/MySQLTransaction.cpp | |
104 ${MYSQL_CLIENT_SOURCES} | |
105 ) | |
106 else() | |
107 unset(USE_SYSTEM_MYSQL_CLIENT CACHE) | |
108 add_definitions(-DORTHANC_ENABLE_MYSQL=0) | |
109 endif() | |
110 | |
111 | |
112 | |
113 ##################################################################### | |
114 ## Configure PostgreSQL client if need be | |
115 ##################################################################### | |
116 | |
117 if (ENABLE_POSTGRESQL_BACKEND) | |
118 include(${CMAKE_CURRENT_LIST_DIR}/PostgreSQLConfiguration.cmake) | |
119 add_definitions(-DORTHANC_ENABLE_POSTGRESQL=1) | |
120 list(APPEND DATABASES_SOURCES | |
121 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLDatabase.cpp | |
122 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLLargeObject.cpp | |
123 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLParameters.cpp | |
124 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLResult.cpp | |
125 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLStatement.cpp | |
126 ${ORTHANC_DATABASES_ROOT}/Framework/PostgreSQL/PostgreSQLTransaction.cpp | |
127 ${LIBPQ_SOURCES} | |
128 ) | |
129 else() | |
130 unset(USE_SYSTEM_LIBPQ CACHE) | |
131 add_definitions(-DORTHANC_ENABLE_POSTGRESQL=0) | |
132 endif() |