annotate Resources/CMake/MariaDBConfiguration.cmake @ 517:2155c39914a2

fix SDK 1.12.4 protobuf
author Alain Mazy <am@orthanc.team>
date Thu, 06 Jun 2024 12:34:43 +0200
parents 54d518dcd74a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 # Orthanc - A Lightweight, RESTful DICOM Store
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Department, University Hospital of Liege, Belgium
507
54d518dcd74a updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 459
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: 459
diff changeset
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
459
ecd0b719cff5 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 426
diff changeset
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 #
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 # This program is free software: you can redistribute it and/or
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # modify it under the terms of the GNU Affero General Public License
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 # as published by the Free Software Foundation, either version 3 of
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 # the License, or (at your option) any later version.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 #
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful, but
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 # Affero General Public License for more details.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 #
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 # You should have received a copy of the GNU Affero General Public License
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 if (STATIC_BUILD OR NOT USE_SYSTEM_MYSQL_CLIENT)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 set(MARIADB_CLIENT_VERSION_MAJOR "10")
184
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
24 set(MARIADB_CLIENT_VERSION_MINOR "5")
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
25 set(MARIADB_CLIENT_VERSION_PATCH "5")
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
26 set(MARIADB_PACKAGE_VERSION "3.1.11")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 set(MARIADB_CLIENT_SOURCES_DIR ${CMAKE_BINARY_DIR}/mariadb-connector-c-${MARIADB_PACKAGE_VERSION}-src)
184
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
28 set(MARIADB_CLIENT_MD5 "cf9da5f0ac9ec72dd8309bdc1d1c6c2f")
426
d700c8f9fc24 migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 405
diff changeset
29 set(MARIADB_CLIENT_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/mariadb-connector-c-${MARIADB_PACKAGE_VERSION}-src.tar.gz")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 if (IS_DIRECTORY "${MARIADB_CLIENT_SOURCES_DIR}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 set(FirstRun OFF)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 else()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 set(FirstRun ON)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 DownloadPackage(${MARIADB_CLIENT_MD5} ${MARIADB_CLIENT_URL} "${MARIADB_CLIENT_SOURCES_DIR}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 if (FirstRun)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 execute_process(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
184
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
42 ${CMAKE_CURRENT_LIST_DIR}/../MariaDB/mariadb-connector-c-${MARIADB_PACKAGE_VERSION}.patch
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 RESULT_VARIABLE Failure
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 if (Failure)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 message(FATAL_ERROR "Error while patching a file")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 include(${MARIADB_CLIENT_SOURCES_DIR}/cmake/CheckIncludeFiles.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 include(${MARIADB_CLIENT_SOURCES_DIR}/cmake/CheckFunctions.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 include(${MARIADB_CLIENT_SOURCES_DIR}/cmake/CheckTypes.cmake)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
184
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
57 set(MARIADB_CLIENT_VERSION "${MARIADB_CLIENT_VERSION_MAJOR}.${MARIADB_CLIENT_VERSION_MINOR}")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 set(MARIADB_BASE_VERSION "mariadb-${MARIADB_CLIENT_VERSION_MAJOR}.${MARIADB_CLIENT_VERSION_MINOR}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 math(EXPR MARIADB_VERSION_ID "${MARIADB_CLIENT_VERSION_MAJOR} * 10000 +
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 ${MARIADB_CLIENT_VERSION_MINOR} * 100 +
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 ${MARIADB_CLIENT_VERSION_PATCH}")
184
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
62
185
7c46155b5bb4 fix mingw build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 184
diff changeset
63 add_definitions(-DHAVE_DLOPEN=1)
7c46155b5bb4 fix mingw build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 184
diff changeset
64 #set(HAVE_DLOPEN 1) # Replaced by the C macro above in 3.1.11
7c46155b5bb4 fix mingw build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 184
diff changeset
65
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 set(PROTOCOL_VERSION ${MARIADB_CLIENT_VERSION_MAJOR})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 set(MARIADB_PORT 3306)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 set(MARIADB_UNIX_ADDR "/var/run/mysqld/mysqld.sock")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 set(DEFAULT_CHARSET "latin1")
184
e8c3c92f2532 upgade to mariadb-connector-c 3.1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 183
diff changeset
70 set(ENABLED_LOCAL_INFILE "AUTO")
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 FOREACH(plugin mysql_native_password mysql_old_password pvio_socket)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 set(EXTERNAL_PLUGINS "${EXTERNAL_PLUGINS} extern struct st_mysql_client_plugin ${plugin}_client_plugin;\n")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 set(BUILTIN_PLUGINS "${BUILTIN_PLUGINS} (struct st_mysql_client_plugin *)&${plugin}_client_plugin,\n")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ENDFOREACH()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 configure_file(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 ${MARIADB_CLIENT_SOURCES_DIR}/include/ma_config.h.in
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 ${MARIADB_CLIENT_SOURCES_DIR}/include/ma_config.h
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 configure_file(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 ${MARIADB_CLIENT_SOURCES_DIR}/include/mariadb_version.h.in
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 ${MARIADB_CLIENT_SOURCES_DIR}/include/mariadb_version.h
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 configure_file(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_client_plugin.c.in
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_client_plugin.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 include_directories(
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 ${MARIADB_CLIENT_SOURCES_DIR}/include
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 )
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 set(MYSQL_CLIENT_SOURCES
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_alloc.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_array.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_charset.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_client_plugin.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_compress.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_context.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_default.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_dtoa.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_errmsg.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_hash.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_init.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_io.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_list.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_ll2str.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_loaddata.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_net.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_password.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_pvio.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_sha1.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_stmt_codec.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_string.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_time.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/ma_tls.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/mariadb_async.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/mariadb_charset.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/mariadb_dyncol.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/mariadb_lib.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/mariadb_stmt.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 ${MARIADB_CLIENT_SOURCES_DIR}/libmariadb/secure/openssl.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 ${MARIADB_CLIENT_SOURCES_DIR}/plugins/auth/my_auth.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 ${MARIADB_CLIENT_SOURCES_DIR}/plugins/auth/old_password.c
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 ${MARIADB_CLIENT_SOURCES_DIR}/plugins/pvio/pvio_socket.c
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
7
a84b487ccbdc fix openssl linking
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
131 set_property(
a84b487ccbdc fix openssl linking
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
132 SOURCE ${MYSQL_CLIENT_SOURCES}
a84b487ccbdc fix openssl linking
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
133 PROPERTY COMPILE_DEFINITIONS "HAVE_OPENSSL=1;HAVE_TLS=1;HAVE_REMOTEIO=1;HAVE_COMPRESS=1;LIBMARIADB;THREAD"
a84b487ccbdc fix openssl linking
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
134 )
a84b487ccbdc fix openssl linking
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 0
diff changeset
135
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 link_libraries(shlwapi)
183
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
138
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
139 # MariaDB connector requires the fibers API (file "fibersapi.h",
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
140 # e.g. function "IsThreadAFiber()"), that was introduced in
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
141 # Windows Vista. This is done by redefining the "_WIN32_WINNT"
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
142 # macro that is initially set to 0x501 (Windows XP) in
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
143 # "OrthancFramework/Resources/CMake/Compiler.cmake".
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
144 # https://docs.microsoft.com/en-us/windows/win32/api/fibersapi/nf-fibersapi-isthreadafiber
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
145 remove_definitions(
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
146 -DWINVER=0x0501
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
147 -D_WIN32_WINNT=0x0501
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
148 )
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
149 add_definitions(
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
150 -DWINVER=0x0600
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
151 -D_WIN32_WINNT=0x0600
2f94b2046d7c upgrade to openssl 1.1.1, fix build if using MinGW 32bits
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 150
diff changeset
152 )
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 else()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 find_path(MYSQLCLIENT_INCLUDE_DIR mysql.h
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 /usr/local/include/mysql
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 /usr/include/mysql
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 if (MYSQLCLIENT_INCLUDE_DIR)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 include_directories(${MYSQLCLIENT_INCLUDE_DIR})
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 set(CMAKE_REQUIRED_INCLUDES "${MYSQLCLIENT_INCLUDE_DIR}")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 check_include_file(mysql.h HAVE_MYSQL_CLIENT_H)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 if (NOT HAVE_MYSQL_CLIENT_H)
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 message(FATAL_ERROR "Please install the libmysqlclient-dev package")
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 endif()
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
150
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
171 find_library(MYSQL_CLIENT_LIB NAMES mysqlclient PATHS
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
172 /usr/lib/mysql
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
173 /usr/local/lib/mysql
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
174 )
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
175
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
176 if (MYSQL_CLIENT_LIB)
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
177 check_library_exists(${MYSQL_CLIENT_LIB} mysql_init "" HAVE_MYSQL_CLIENT_LIB)
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
178 if (NOT HAVE_MYSQL_CLIENT_LIB)
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
179 message(FATAL_ERROR "Unable to use mysql_init from mysqlclient library")
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
180 endif()
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
181 get_filename_component(MYSQL_CLIENT_LIB_PATH ${MYSQL_CLIENT_LIB} DIRECTORY)
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
182 link_directories(${MYSQL_CLIENT_LIB_PATH})
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
183 link_libraries(mysqlclient)
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
184 else()
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
185 message(FATAL_ERROR "Unable to find the mysqlclient library")
d9101318442d fix linking MySQL on FreeBSD: https://groups.google.com/d/msg/orthanc-users/BbLvEoHFw18/pu9d8MyvBQAJ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
186 endif()
0
7cea966b6829 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 endif()