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

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

253 254
set(LINPHONE_OBJC_SOURCE_FILES)
if (APPLE)
255 256
	list(APPEND LINPHONE_OBJC_SOURCE_FILES core/paths/paths-apple.mm)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-apple.h)
257

258 259
elseif (ANDROID)
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-android.cpp core/platform-helpers/android-platform-helpers.cpp)
260
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-android.h)
261

262
elseif (WIN32)
263 264
	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)
265

266
elseif (UNIX)
267 268
	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)
269
endif ()
270

271
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS} ${LIBXSD_INCLUDE_DIRS})
272
set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
273 274
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS})

275
if (SOCI_FOUND)
276
	list(APPEND LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${SOCI_INCLUDE_DIRS} ${SOCI_MYSQL_INCLUDES})
Ronan's avatar
Ronan committed
277
	add_definitions(-DSOCI_ENABLED)
278
endif ()
279 280

set(LINPHONE_PRIVATE_HEADER_FILES)
281
foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
282
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
283
endforeach ()
284 285 286
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
287
bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
288

289
if (ENABLE_STATIC)
290 291
	add_library(
		linphone-cxx-objects-static OBJECT
292
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
293
	)
294
	target_compile_definitions(linphone-cxx-objects-static PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
295
	target_include_directories(linphone-cxx-objects-static SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
296
endif ()
297

298
if (ENABLE_SHARED)
299 300
	add_library(
		linphone-cxx-objects OBJECT
301
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
302
	)
303
	target_compile_definitions(linphone-cxx-objects PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS})
304
	target_include_directories(linphone-cxx-objects SYSTEM PRIVATE ${LINPHONE_CXX_OBJECTS_INCLUDE_DIRS} ${LINPHONE_INCLUDE_DIRS})
305
	target_compile_options(linphone-cxx-objects PRIVATE "-fPIC")
306
endif ()