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

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

271 272
set(LINPHONE_OBJC_SOURCE_FILES)
if (APPLE)
273 274
	list(APPEND LINPHONE_OBJC_SOURCE_FILES core/paths/paths-apple.mm)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-apple.h)
275 276
elseif (ANDROID)
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-android.cpp core/platform-helpers/android-platform-helpers.cpp)
277
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-android.h)
278
elseif (WIN32)
279 280
	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)
281
elseif (UNIX)
282 283
	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)
284
endif ()
285

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

290
if (SOCI_FOUND)
291
	list(APPEND LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${SOCI_INCLUDE_DIRS} ${SOCI_MYSQL_INCLUDES})
Ronan's avatar
Ronan committed
292
	add_definitions(-DSOCI_ENABLED)
293 294 295 296 297 298 299 300 301

	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
		db/internal/safe-transaction.h
		db/internal/statements.h
	)

	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES
		db/internal/statements.cpp
	)
302
endif ()
303 304

set(LINPHONE_PRIVATE_HEADER_FILES)
305
foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
306
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
307
endforeach ()
308 309 310
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
311
bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
312

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

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