CMakeLists.txt 11.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
############################################################################
# CMakeLists.txt
# Copyright (C) 2017  Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
############################################################################

set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
24
	address/address-p.h
Ronan's avatar
Ronan committed
25
	address/address.h
26
	address/identity-address.h
27
	c-wrapper/c-wrapper.h
28
	c-wrapper/internal/c-sal.h
Ronan's avatar
Ronan committed
29
	c-wrapper/internal/c-tools.h
30
	call/call-p.h
31
	call/call.h
32 33 34 35
	call/local-conference-call-p.h
	call/local-conference-call.h
	call/remote-conference-call-p.h
	call/remote-conference-call.h
Ronan's avatar
Ronan committed
36 37
	chat/chat-message/chat-message-p.h
	chat/chat-message/chat-message.h
38 39
	chat/chat-room/abstract-chat-room-p.h
	chat/chat-room/abstract-chat-room.h
Ronan's avatar
Ronan committed
40 41
	chat/chat-room/basic-chat-room-p.h
	chat/chat-room/basic-chat-room.h
42
	chat/chat-room/basic-to-client-group-chat-room.h
43
	chat/chat-room/chat-room-id.h
44
	chat/chat-room/chat-room-listener.h
Ronan's avatar
Ronan committed
45 46 47 48
	chat/chat-room/chat-room-p.h
	chat/chat-room/chat-room.h
	chat/chat-room/client-group-chat-room-p.h
	chat/chat-room/client-group-chat-room.h
49 50 51
	chat/chat-room/client-group-to-basic-chat-room.h
	chat/chat-room/proxy-chat-room-p.h
	chat/chat-room/proxy-chat-room.h
Ronan's avatar
Ronan committed
52 53
	chat/chat-room/real-time-text-chat-room-p.h
	chat/chat-room/real-time-text-chat-room.h
54 55
	chat/chat-room/server-group-chat-room-p.h
	chat/chat-room/server-group-chat-room.h
Ronan's avatar
Ronan committed
56 57 58 59 60 61 62
	chat/cpim/cpim.h
	chat/cpim/header/cpim-core-headers.h
	chat/cpim/header/cpim-generic-header.h
	chat/cpim/header/cpim-header-p.h
	chat/cpim/header/cpim-header.h
	chat/cpim/message/cpim-message.h
	chat/cpim/parser/cpim-parser.h
63 64
	chat/modifier/chat-message-modifier.h
	chat/modifier/cpim-chat-message-modifier.h
65
	chat/modifier/encryption-chat-message-modifier.h
66
	chat/modifier/file-transfer-chat-message-modifier.h
67
	chat/modifier/multipart-chat-message-modifier.h
68 69
	chat/notification/imdn.h
	chat/notification/is-composing-listener.h
70
	chat/notification/is-composing.h
71
	conference/conference-listener.h
72
	conference/conference-p.h
73
	conference/conference.h
74 75 76 77
	conference/handlers/local-conference-event-handler-p.h
	conference/handlers/local-conference-event-handler.h
	conference/handlers/remote-conference-event-handler-p.h
	conference/handlers/remote-conference-event-handler.h
78
	conference/local-conference-p.h
Ronan's avatar
Ronan committed
79
	conference/local-conference.h
80
	conference/params/call-session-params-p.h
81
	conference/params/call-session-params.h
82
	conference/params/media-session-params-p.h
83
	conference/params/media-session-params.h
84
	conference/participant-device.h
85
	conference/participant-p.h
86
	conference/participant.h
87
	conference/remote-conference-p.h
Ronan's avatar
Ronan committed
88
	conference/remote-conference.h
89
	conference/session/call-session-listener.h
90
	conference/session/call-session-p.h
91
	conference/session/call-session.h
92
	conference/session/media-session.h
93
	conference/session/port-config.h
94
	containers/lru-cache.h
95
	content/content-manager.h
96
	content/content-p.h
Ronan's avatar
Ronan committed
97 98
	content/content-type.h
	content/content.h
99 100
	content/file-content.h
	content/file-transfer-content.h
101
	core/core-accessor.h
102
	core/core-listener.h
103
	core/core-p.h
Ronan's avatar
Ronan committed
104
	core/core.h
105 106
	core/paths/paths.h
	core/platform-helpers/platform-helpers.h
Ronan's avatar
Ronan committed
107 108
	db/abstract/abstract-db-p.h
	db/abstract/abstract-db.h
109
	db/main-db-chat-message-key.h
110
	db/main-db-event-key.h
111 112
	db/main-db-key-p.h
	db/main-db-key.h
Ronan's avatar
Ronan committed
113
	db/main-db-p.h
114
	db/main-db.h
115
	db/session/db-session-p.h
116 117
	dial-plan/dial-plan-p.h
	dial-plan/dial-plan.h
Ronan's avatar
Ronan committed
118
	enums.h
119
	event-log/conference/conference-call-event.h
Ronan's avatar
Ronan committed
120 121 122 123 124 125 126 127
	event-log/conference/conference-event-p.h
	event-log/conference/conference-event.h
	event-log/conference/conference-notified-event-p.h
	event-log/conference/conference-notified-event.h
	event-log/conference/conference-participant-device-event.h
	event-log/conference/conference-participant-event-p.h
	event-log/conference/conference-participant-event.h
	event-log/conference/conference-subject-event.h
Ronan's avatar
Ronan committed
128 129
	event-log/event-log-p.h
	event-log/event-log.h
130
	event-log/events.h
Ghislain MARY's avatar
Ghislain MARY committed
131
	hacks/hacks.h
Ronan's avatar
Ronan committed
132
	logger/logger.h
133 134
	nat/ice-agent.h
	nat/stun-client.h
Ronan's avatar
Ronan committed
135
	object/app-data-container.h
136 137
	object/base-object-p.h
	object/base-object.h
Ghislain MARY's avatar
Ghislain MARY committed
138
	object/clonable-object-p.h
Ronan's avatar
Ronan committed
139
	object/clonable-object.h
140
	object/clonable-shared-pointer.h
141 142
	object/object-head-p.h
	object/object-head.h
143
	object/object-p.h
Ronan's avatar
Ronan committed
144
	object/object.h
145
	object/property-container.h
146
	object/singleton.h
147
	sal/sal.h
Erwan Croze's avatar
Erwan Croze committed
148
	search/magic-search-p.h
149
	search/magic-search.h
Erwan Croze's avatar
Erwan Croze committed
150
	search/search-result-p.h
151
	search/search-result.h
152
	utils/background-task.h
153
	utils/payload-type-handler.h
154
	variant/variant.h
155
	xml/conference-info.h
156
	xml/resource-lists.h
157
	xml/xml.h
158 159 160
)

set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
Ronan's avatar
Ronan committed
161
	address/address.cpp
162
	address/identity-address.cpp
163
	c-wrapper/api/c-address.cpp
164
	c-wrapper/api/c-call-cbs.cpp
165
	c-wrapper/api/c-call-params.cpp
166
	c-wrapper/api/c-call-stats.cpp
Ronan's avatar
Ronan committed
167
	c-wrapper/api/c-call.cpp
168
	c-wrapper/api/c-chat-message-cbs.cpp
Ronan's avatar
Ronan committed
169
	c-wrapper/api/c-chat-message.cpp
170
	c-wrapper/api/c-chat-room-cbs.cpp
Ronan's avatar
Ronan committed
171
	c-wrapper/api/c-chat-room.cpp
172
	c-wrapper/api/c-core.cpp
173
	c-wrapper/api/c-dial-plan.cpp
Ronan's avatar
Ronan committed
174
	c-wrapper/api/c-event-log.cpp
Erwan Croze's avatar
Erwan Croze committed
175
	c-wrapper/api/c-magic-search.cpp
176
	c-wrapper/api/c-participant.cpp
Erwan Croze's avatar
Erwan Croze committed
177
	c-wrapper/api/c-search-result.cpp
178
	c-wrapper/internal/c-sal.cpp
179
	c-wrapper/internal/c-tools.cpp
180
	call/call.cpp
181 182
	call/local-conference-call.cpp
	call/remote-conference-call.cpp
Ronan's avatar
Ronan committed
183
	chat/chat-message/chat-message.cpp
184
	chat/chat-room/abstract-chat-room.cpp
Ronan's avatar
Ronan committed
185
	chat/chat-room/basic-chat-room.cpp
186
	chat/chat-room/basic-to-client-group-chat-room.cpp
187
	chat/chat-room/chat-room-id.cpp
Ronan's avatar
Ronan committed
188 189
	chat/chat-room/chat-room.cpp
	chat/chat-room/client-group-chat-room.cpp
190 191
	chat/chat-room/client-group-to-basic-chat-room.cpp
	chat/chat-room/proxy-chat-room.cpp
Ronan's avatar
Ronan committed
192
	chat/chat-room/real-time-text-chat-room.cpp
193
	chat/chat-room/server-group-chat-room-stub.cpp
Ronan's avatar
Ronan committed
194 195 196 197 198
	chat/cpim/header/cpim-core-headers.cpp
	chat/cpim/header/cpim-generic-header.cpp
	chat/cpim/header/cpim-header.cpp
	chat/cpim/message/cpim-message.cpp
	chat/cpim/parser/cpim-parser.cpp
199
	chat/modifier/cpim-chat-message-modifier.cpp
200
	chat/modifier/encryption-chat-message-modifier.cpp
201
	chat/modifier/file-transfer-chat-message-modifier.cpp
202
	chat/modifier/multipart-chat-message-modifier.cpp
203 204
	chat/notification/imdn.cpp
	chat/notification/is-composing.cpp
205
	conference/conference.cpp
206 207
	conference/handlers/local-conference-event-handler.cpp
	conference/handlers/remote-conference-event-handler.cpp
Ronan's avatar
Ronan committed
208
	conference/local-conference.cpp
209 210
	conference/params/call-session-params.cpp
	conference/params/media-session-params.cpp
211
	conference/participant-device.cpp
212
	conference/participant.cpp
Ronan's avatar
Ronan committed
213
	conference/remote-conference.cpp
214 215
	conference/session/call-session.cpp
	conference/session/media-session.cpp
216
	content/content-manager.cpp
Ronan's avatar
Ronan committed
217 218
	content/content-type.cpp
	content/content.cpp
219 220
	content/file-content.cpp
	content/file-transfer-content.cpp
221
	core/core-accessor.cpp
222
	core/core-call.cpp
223
	core/core-chat-room.cpp
224
	core/core.cpp
225 226
	core/paths/paths.cpp
	core/platform-helpers/platform-helpers.cpp
Ronan's avatar
Ronan committed
227
	db/abstract/abstract-db.cpp
228
	db/main-db-chat-message-key.cpp
229
	db/main-db-event-key.cpp
230
	db/main-db-key.cpp
231
	db/main-db.cpp
232
	db/session/db-session.cpp
233
	dial-plan/dial-plan.cpp
234
	event-log/conference/conference-call-event.cpp
235
	event-log/conference/conference-chat-message-event.cpp
Ronan's avatar
Ronan committed
236 237 238 239 240
	event-log/conference/conference-event.cpp
	event-log/conference/conference-notified-event.cpp
	event-log/conference/conference-participant-device-event.cpp
	event-log/conference/conference-participant-event.cpp
	event-log/conference/conference-subject-event.cpp
Ronan's avatar
Ronan committed
241
	event-log/event-log.cpp
Ghislain MARY's avatar
Ghislain MARY committed
242
	hacks/hacks.cpp
Ronan's avatar
Ronan committed
243
	logger/logger.cpp
244 245
	nat/ice-agent.cpp
	nat/stun-client.cpp
Ronan's avatar
Ronan committed
246
	object/app-data-container.cpp
247
	object/base-object.cpp
Ghislain MARY's avatar
Ghislain MARY committed
248
	object/clonable-object.cpp
249
	object/object.cpp
250
	object/property-container.cpp
251 252 253 254 255
	sal/call-op.cpp
	sal/event-op.cpp
	sal/message-op.cpp
	sal/op.cpp
	sal/presence-op.cpp
Ronan's avatar
Ronan committed
256
	sal/refer-op.cpp
257 258
	sal/register-op.cpp
	sal/sal.cpp
Erwan Croze's avatar
Erwan Croze committed
259 260
	search/magic-search.cpp
	search/search-result.cpp
261
	utils/background-task.cpp
262
	utils/fs.cpp
263
	utils/general.cpp
264
	utils/payload-type-handler.cpp
265
	utils/utils.cpp
266
	variant/variant.cpp
267
	xml/conference-info.cpp
268
	xml/resource-lists.cpp
269
	xml/xml.cpp
270 271
)

272 273
set(LINPHONE_OBJC_SOURCE_FILES)
if (APPLE)
274 275
	list(APPEND LINPHONE_OBJC_SOURCE_FILES core/paths/paths-apple.mm)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-apple.h)
276 277
elseif (ANDROID)
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-android.cpp core/platform-helpers/android-platform-helpers.cpp)
278
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-android.h)
279
elseif (WIN32)
280 281
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-windows.cpp)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-windows.h)
282
elseif (UNIX)
283 284
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-linux.cpp)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-linux.h)
285
endif ()
286

287
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS} ${LIBXSD_INCLUDE_DIRS})
288
set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
289 290
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS})

291
if (SOCI_FOUND)
292
	list(APPEND LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${SOCI_INCLUDE_DIRS} ${SOCI_MYSQL_INCLUDES})
Ronan's avatar
Ronan committed
293
	add_definitions(-DSOCI_ENABLED)
294 295

	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
296 297
		db/internal/db-exception-handler.h
		db/internal/smart-transaction.h
298 299 300 301 302 303
		db/internal/statements.h
	)

	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES
		db/internal/statements.cpp
	)
304
endif ()
305 306

set(LINPHONE_PRIVATE_HEADER_FILES)
307
foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
308
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
309
endforeach ()
310 311 312
set(LINPHONE_PRIVATE_HEADER_FILES ${LINPHONE_PRIVATE_HEADER_FILES} PARENT_SCOPE)

bc_apply_compile_flags(LINPHONE_CXX_OBJECTS_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
Benjamin REIS's avatar
Benjamin REIS committed
313
bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
314

315
if (ENABLE_STATIC)
316 317
	add_library(
		linphone-cxx-objects-static OBJECT
318
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
319
	)
320
	target_compile_definitions(linphone-cxx-objects-static PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
321
	target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
322
endif ()
323

324
if (ENABLE_SHARED)
325 326
	add_library(
		linphone-cxx-objects OBJECT
327
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
328
	)
329
	target_compile_definitions(linphone-cxx-objects PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
330
	target_include_directories(linphone-cxx-objects SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
331
	target_compile_options(linphone-cxx-objects PRIVATE "-fPIC")
332
endif ()