comparison Resources/CMake/DatabasesFrameworkConfiguration.cmake @ 0:7cea966b6829

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