CMakeLists.txt 11.4 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 86
	conference/participant-imdn-state.h
	conference/participant-imdn-state-p.h
87
	conference/participant-p.h
88
	conference/participant.h
89
	conference/remote-conference-p.h
Ronan's avatar
Ronan committed
90
	conference/remote-conference.h
91
	conference/session/call-session-listener.h
92
	conference/session/call-session-p.h
93
	conference/session/call-session.h
94
	conference/session/media-session.h
95
	conference/session/port-config.h
96
	containers/lru-cache.h
97
	content/content-disposition.h
98
	content/content-manager.h
99
	content/content-p.h
Ronan's avatar
Ronan committed
100 101
	content/content-type.h
	content/content.h
102 103
	content/file-content.h
	content/file-transfer-content.h
104 105 106
	content/header/header.h
	content/header/header-p.h
	content/header/header-param.h
107
	core/core-accessor.h
108
	core/core-listener.h
109
	core/core-p.h
Ronan's avatar
Ronan committed
110
	core/core.h
111 112
	core/paths/paths.h
	core/platform-helpers/platform-helpers.h
Ronan's avatar
Ronan committed
113 114
	db/abstract/abstract-db-p.h
	db/abstract/abstract-db.h
115 116
	db/internal/db-transaction.h
	db/internal/statements.h
117
	db/main-db-chat-message-key.h
118
	db/main-db-event-key.h
119 120
	db/main-db-key-p.h
	db/main-db-key.h
Ronan's avatar
Ronan committed
121
	db/main-db-p.h
122
	db/main-db.h
Ronan's avatar
Ronan committed
123
	db/session/db-session.h
124 125
	dial-plan/dial-plan-p.h
	dial-plan/dial-plan.h
Ronan's avatar
Ronan committed
126
	enums.h
127
	event-log/conference/conference-call-event.h
Ronan's avatar
Ronan committed
128 129 130 131 132 133 134 135
	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
136 137
	event-log/event-log-p.h
	event-log/event-log.h
138
	event-log/events.h
Ghislain MARY's avatar
Ghislain MARY committed
139
	hacks/hacks.h
Ronan's avatar
Ronan committed
140
	logger/logger.h
141 142
	nat/ice-agent.h
	nat/stun-client.h
Ronan's avatar
Ronan committed
143
	object/app-data-container.h
144 145
	object/base-object-p.h
	object/base-object.h
Ghislain MARY's avatar
Ghislain MARY committed
146
	object/clonable-object-p.h
Ronan's avatar
Ronan committed
147
	object/clonable-object.h
148
	object/clonable-shared-pointer.h
149 150
	object/object-head-p.h
	object/object-head.h
151
	object/object-p.h
Ronan's avatar
Ronan committed
152
	object/object.h
153
	object/property-container.h
154
	object/singleton.h
155
	sal/sal.h
Erwan Croze's avatar
Erwan Croze committed
156
	search/magic-search-p.h
157 158
	search/magic-search.h
	search/search-result.h
159
	utils/background-task.h
160
	utils/payload-type-handler.h
161
	variant/variant.h
162
	xml/conference-info.h
163
	xml/resource-lists.h
164
	xml/xml.h
165 166 167
)

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

286 287
set(LINPHONE_OBJC_SOURCE_FILES)
if (APPLE)
288 289
	list(APPEND LINPHONE_OBJC_SOURCE_FILES core/paths/paths-apple.mm)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-apple.h)
290 291
elseif (ANDROID)
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-android.cpp core/platform-helpers/android-platform-helpers.cpp)
292
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-android.h)
293
elseif (WIN32)
294 295
	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)
296
elseif (UNIX)
297 298
	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)
299
endif ()
300

301 302 303 304 305 306
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS
	${BELR_INCLUDE_DIRS}
	${LIBXSD_INCLUDE_DIRS}
	${SOCI_INCLUDE_DIRS}
	${SOCI_MYSQL_INCLUDES}
)
307
set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
308 309
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS})

310
set(LINPHONE_PRIVATE_HEADER_FILES)
311
foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
312
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
313
endforeach ()
314 315 316
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
317
bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
318

319
if (ENABLE_STATIC)
320 321
	add_library(
		linphone-cxx-objects-static OBJECT
322
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
323
	)
324
	target_compile_definitions(linphone-cxx-objects-static PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
325
	target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
326
endif ()
327

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