CMakeLists.txt 16 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
############################################################################
# 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.
#
############################################################################

Ghislain MARY's avatar
Ghislain MARY committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
set(LIBS
	${BCTOOLBOX_CORE_LIBRARIES}
	${BELLESIP_LIBRARIES}
	${MEDIASTREAMER2_LIBRARIES}
	${ORTP_LIBRARIES}
	${XML2_LIBRARIES}
	${BELR_LIBRARIES}
	${LIBXSD_LIBRARIES}
)
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
	list(APPEND LIBS "Ws2_32")
endif()
if(ENABLE_LIME)
	list(APPEND LIBS ${BZRTP_LIBRARIES})
endif()
if(ZLIB_FOUND)
	list(APPEND LIBS ${ZLIB_LIBRARIES})
endif()
if(SOCI_FOUND)
	list(APPEND LIBS ${SOCI_LIBRARIES})
endif()
if(SQLITE3_FOUND)
	list(APPEND LIBS ${SQLITE3_LIBRARIES})
endif()
if(ICONV_FOUND)
	list(APPEND LIBS ${ICONV_LIBRARIES})
endif()
if(ENABLE_TUNNEL)
	list(APPEND LIBS ${TUNNEL_LIBRARIES})
endif()
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
	list(APPEND LIBS ${LIBGCC} ${LIBMINGWEX})
endif()
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
	list(APPEND LIBS shlwapi)
endif()
if(INTL_FOUND)
	list(APPEND LIBS ${INTL_LIBRARIES})
endif()
if(BELCARD_FOUND)
	list(APPEND LIBS ${BELCARD_LIBRARIES})
endif()
65 66 67
if(ENABLE_TUNNEL)
	add_definitions(-DTUNNEL_ENABLED)
endif()
Ghislain MARY's avatar
Ghislain MARY committed
68

69
set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
70
	address/address-p.h
Ronan's avatar
Ronan committed
71
	address/address.h
72
	address/identity-address.h
73
	c-wrapper/c-wrapper.h
74
	c-wrapper/internal/c-sal.h
Ronan's avatar
Ronan committed
75
	c-wrapper/internal/c-tools.h
76
	call/call-p.h
77
	call/call.h
78 79 80 81
	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
82 83
	chat/chat-message/chat-message-p.h
	chat/chat-message/chat-message.h
Ghislain MARY's avatar
Ghislain MARY committed
84
	chat/chat-message/imdn-message.h
85
	chat/chat-message/imdn-message-p.h
Ghislain MARY's avatar
Ghislain MARY committed
86
	chat/chat-message/is-composing-message.h
87
	chat/chat-message/notification-message.h
Ghislain MARY's avatar
Ghislain MARY committed
88
	chat/chat-message/notification-message-p.h
89 90
	chat/chat-room/abstract-chat-room-p.h
	chat/chat-room/abstract-chat-room.h
Ronan's avatar
Ronan committed
91 92
	chat/chat-room/basic-chat-room-p.h
	chat/chat-room/basic-chat-room.h
93
	chat/chat-room/basic-to-client-group-chat-room.h
94
	chat/chat-room/chat-room-id.h
95
	chat/chat-room/chat-room-listener.h
Ronan's avatar
Ronan committed
96 97 98 99
	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
100 101 102
	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
103 104
	chat/chat-room/real-time-text-chat-room-p.h
	chat/chat-room/real-time-text-chat-room.h
105 106
	chat/chat-room/server-group-chat-room-p.h
	chat/chat-room/server-group-chat-room.h
Ronan's avatar
Ronan committed
107 108 109 110 111 112 113
	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
114 115
	chat/modifier/chat-message-modifier.h
	chat/modifier/cpim-chat-message-modifier.h
116
	chat/modifier/encryption-chat-message-modifier.h
117
	chat/modifier/file-transfer-chat-message-modifier.h
118
	chat/modifier/multipart-chat-message-modifier.h
119 120
	chat/notification/imdn.h
	chat/notification/is-composing-listener.h
121
	chat/notification/is-composing.h
122
	conference/conference-listener.h
123
	conference/conference-p.h
124
	conference/conference.h
125 126
	conference/handlers/local-conference-event-handler-p.h
	conference/handlers/local-conference-event-handler.h
Benjamin REIS's avatar
Benjamin REIS committed
127
	conference/handlers/local-conference-list-event-handler.h
128 129
	conference/handlers/remote-conference-event-handler-p.h
	conference/handlers/remote-conference-event-handler.h
Benjamin REIS's avatar
Benjamin REIS committed
130
	conference/handlers/remote-conference-list-event-handler.h
131
	conference/local-conference-p.h
Ronan's avatar
Ronan committed
132
	conference/local-conference.h
133
	conference/params/call-session-params-p.h
134
	conference/params/call-session-params.h
135
	conference/params/media-session-params-p.h
136
	conference/params/media-session-params.h
137
	conference/participant-device.h
138 139
	conference/participant-imdn-state.h
	conference/participant-imdn-state-p.h
140
	conference/participant-p.h
141
	conference/participant.h
142
	conference/remote-conference-p.h
Ronan's avatar
Ronan committed
143
	conference/remote-conference.h
144
	conference/session/call-session-listener.h
145
	conference/session/call-session-p.h
146
	conference/session/call-session.h
147
	conference/session/media-session.h
148
	conference/session/port-config.h
149
	containers/lru-cache.h
150
	content/content-disposition.h
151
	content/content-manager.h
152
	content/content-p.h
Ronan's avatar
Ronan committed
153 154
	content/content-type.h
	content/content.h
155 156
	content/file-content.h
	content/file-transfer-content.h
157 158 159
	content/header/header.h
	content/header/header-p.h
	content/header/header-param.h
160
	core/core-accessor.h
161
	core/core-listener.h
162
	core/core-p.h
Ronan's avatar
Ronan committed
163
	core/core.h
164 165
	core/paths/paths.h
	core/platform-helpers/platform-helpers.h
Ronan's avatar
Ronan committed
166 167
	db/abstract/abstract-db-p.h
	db/abstract/abstract-db.h
168 169
	db/internal/db-transaction.h
	db/internal/statements.h
170
	db/main-db-chat-message-key.h
171
	db/main-db-event-key.h
172 173
	db/main-db-key-p.h
	db/main-db-key.h
Ronan's avatar
Ronan committed
174
	db/main-db-p.h
175
	db/main-db.h
Ronan's avatar
Ronan committed
176
	db/session/db-session.h
177 178
	dial-plan/dial-plan-p.h
	dial-plan/dial-plan.h
Ronan's avatar
Ronan committed
179
	enums.h
180
	event-log/conference/conference-call-event.h
Ronan's avatar
Ronan committed
181 182 183 184 185 186 187 188
	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
189 190
	event-log/event-log-p.h
	event-log/event-log.h
191
	event-log/events.h
Ghislain MARY's avatar
Ghislain MARY committed
192
	hacks/hacks.h
Ronan's avatar
Ronan committed
193
	logger/logger.h
194 195
	nat/ice-agent.h
	nat/stun-client.h
Ronan's avatar
Ronan committed
196
	object/app-data-container.h
197 198
	object/base-object-p.h
	object/base-object.h
Ghislain MARY's avatar
Ghislain MARY committed
199
	object/clonable-object-p.h
Ronan's avatar
Ronan committed
200
	object/clonable-object.h
201
	object/clonable-shared-pointer.h
202 203
	object/object-head-p.h
	object/object-head.h
204
	object/object-p.h
Ronan's avatar
Ronan committed
205
	object/object.h
206
	object/property-container.h
207
	object/singleton.h
208
	sal/sal.h
Erwan Croze's avatar
Erwan Croze committed
209
	search/magic-search-p.h
210 211
	search/magic-search.h
	search/search-result.h
212
	utils/background-task.h
213
	utils/payload-type-handler.h
214
	variant/variant.h
215
	xml/conference-info.h
Ghislain MARY's avatar
Ghislain MARY committed
216
	xml/imdn.h
217
	xml/is-composing.h
Ghislain MARY's avatar
Ghislain MARY committed
218
	xml/linphone-imdn.h
219
	xml/resource-lists.h
Benjamin REIS's avatar
Benjamin REIS committed
220
	xml/rlmi.h
221
	xml/xml.h
222 223 224
)

set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
Ronan's avatar
Ronan committed
225
	address/address.cpp
226
	address/identity-address.cpp
227
	c-wrapper/api/c-address.cpp
228
	c-wrapper/api/c-call-cbs.cpp
229
	c-wrapper/api/c-call-params.cpp
230
	c-wrapper/api/c-call-stats.cpp
Ronan's avatar
Ronan committed
231
	c-wrapper/api/c-call.cpp
232
	c-wrapper/api/c-chat-message-cbs.cpp
Ronan's avatar
Ronan committed
233
	c-wrapper/api/c-chat-message.cpp
234
	c-wrapper/api/c-chat-room-cbs.cpp
Ronan's avatar
Ronan committed
235
	c-wrapper/api/c-chat-room.cpp
236
	c-wrapper/api/c-core.cpp
237
	c-wrapper/api/c-content.cpp
238
	c-wrapper/api/c-dial-plan.cpp
Ronan's avatar
Ronan committed
239
	c-wrapper/api/c-event-log.cpp
Erwan Croze's avatar
Erwan Croze committed
240
	c-wrapper/api/c-magic-search.cpp
241
	c-wrapper/api/c-participant.cpp
242
	c-wrapper/api/c-participant-imdn-state.cpp
Erwan Croze's avatar
Erwan Croze committed
243
	c-wrapper/api/c-search-result.cpp
244
	c-wrapper/internal/c-sal.cpp
245
	c-wrapper/internal/c-tools.cpp
246
	call/call.cpp
247 248
	call/local-conference-call.cpp
	call/remote-conference-call.cpp
Ronan's avatar
Ronan committed
249
	chat/chat-message/chat-message.cpp
Ghislain MARY's avatar
Ghislain MARY committed
250
	chat/chat-message/imdn-message.cpp
Ghislain MARY's avatar
Ghislain MARY committed
251
	chat/chat-message/is-composing-message.cpp
252
	chat/chat-message/notification-message.cpp
253
	chat/chat-room/abstract-chat-room.cpp
Ronan's avatar
Ronan committed
254
	chat/chat-room/basic-chat-room.cpp
255
	chat/chat-room/basic-to-client-group-chat-room.cpp
256
	chat/chat-room/chat-room-id.cpp
Ronan's avatar
Ronan committed
257 258
	chat/chat-room/chat-room.cpp
	chat/chat-room/client-group-chat-room.cpp
259 260
	chat/chat-room/client-group-to-basic-chat-room.cpp
	chat/chat-room/proxy-chat-room.cpp
Ronan's avatar
Ronan committed
261
	chat/chat-room/real-time-text-chat-room.cpp
262
	chat/chat-room/server-group-chat-room-stub.cpp
Ronan's avatar
Ronan committed
263 264 265 266 267
	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
268
	chat/modifier/cpim-chat-message-modifier.cpp
269
	chat/modifier/encryption-chat-message-modifier.cpp
270
	chat/modifier/file-transfer-chat-message-modifier.cpp
271
	chat/modifier/multipart-chat-message-modifier.cpp
272 273
	chat/notification/imdn.cpp
	chat/notification/is-composing.cpp
274
	conference/conference.cpp
275
	conference/handlers/local-conference-event-handler.cpp
Benjamin REIS's avatar
Benjamin REIS committed
276
	conference/handlers/local-conference-list-event-handler.cpp
277
	conference/handlers/remote-conference-event-handler.cpp
Benjamin REIS's avatar
Benjamin REIS committed
278
	conference/handlers/remote-conference-list-event-handler.cpp
Ronan's avatar
Ronan committed
279
	conference/local-conference.cpp
280 281
	conference/params/call-session-params.cpp
	conference/params/media-session-params.cpp
282
	conference/participant-device.cpp
283
	conference/participant-imdn-state.cpp
284
	conference/participant.cpp
Ronan's avatar
Ronan committed
285
	conference/remote-conference.cpp
286 287
	conference/session/call-session.cpp
	conference/session/media-session.cpp
288
	content/content-disposition.cpp
289
	content/content-manager.cpp
Ronan's avatar
Ronan committed
290 291
	content/content-type.cpp
	content/content.cpp
292 293
	content/file-content.cpp
	content/file-transfer-content.cpp
294 295
	content/header/header.cpp
	content/header/header-param.cpp
296
	core/core-accessor.cpp
297
	core/core-call.cpp
298
	core/core-chat-room.cpp
299
	core/core.cpp
300 301
	core/paths/paths.cpp
	core/platform-helpers/platform-helpers.cpp
Ronan's avatar
Ronan committed
302
	db/abstract/abstract-db.cpp
303
	db/internal/statements.cpp
304
	db/main-db-chat-message-key.cpp
305
	db/main-db-event-key.cpp
306
	db/main-db-key.cpp
307
	db/main-db.cpp
308
	db/session/db-session.cpp
309
	dial-plan/dial-plan.cpp
310
	event-log/conference/conference-call-event.cpp
311
	event-log/conference/conference-chat-message-event.cpp
Ronan's avatar
Ronan committed
312 313 314 315 316
	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
317
	event-log/event-log.cpp
Ghislain MARY's avatar
Ghislain MARY committed
318
	hacks/hacks.cpp
Ronan's avatar
Ronan committed
319
	logger/logger.cpp
320 321
	nat/ice-agent.cpp
	nat/stun-client.cpp
Ronan's avatar
Ronan committed
322
	object/app-data-container.cpp
323
	object/base-object.cpp
Ghislain MARY's avatar
Ghislain MARY committed
324
	object/clonable-object.cpp
325
	object/object.cpp
326
	object/property-container.cpp
327 328 329 330 331
	sal/call-op.cpp
	sal/event-op.cpp
	sal/message-op.cpp
	sal/op.cpp
	sal/presence-op.cpp
Ronan's avatar
Ronan committed
332
	sal/refer-op.cpp
333 334
	sal/register-op.cpp
	sal/sal.cpp
Erwan Croze's avatar
Erwan Croze committed
335 336
	search/magic-search.cpp
	search/search-result.cpp
337
	utils/background-task.cpp
338
	utils/fs.cpp
339
	utils/general.cpp
340
	utils/payload-type-handler.cpp
341
	utils/utils.cpp
342
	variant/variant.cpp
343
	xml/conference-info.cpp
Ghislain MARY's avatar
Ghislain MARY committed
344
	xml/imdn.cpp
345
	xml/is-composing.cpp
Ghislain MARY's avatar
Ghislain MARY committed
346
	xml/linphone-imdn.cpp
347
	xml/resource-lists.cpp
Benjamin REIS's avatar
Benjamin REIS committed
348
	xml/rlmi.cpp
349
	xml/xml.cpp
350 351
)

352 353
set(LINPHONE_OBJC_SOURCE_FILES)
if (APPLE)
354 355
	list(APPEND LINPHONE_OBJC_SOURCE_FILES core/paths/paths-apple.mm)
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-apple.h)
356
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/platform-helpers/ios-platform-helpers.cpp)
357 358
elseif (ANDROID)
	list(APPEND LINPHONE_CXX_OBJECTS_SOURCE_FILES core/paths/paths-android.cpp core/platform-helpers/android-platform-helpers.cpp)
359
	list(APPEND LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES core/paths/paths-android.h)
360
elseif (WIN32)
361 362
	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)
363
elseif (UNIX)
364 365
	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)
366
endif ()
367

368 369 370 371 372 373
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS
	${BELR_INCLUDE_DIRS}
	${LIBXSD_INCLUDE_DIRS}
	${SOCI_INCLUDE_DIRS}
	${SOCI_MYSQL_INCLUDES}
)
374
set(LINPHONE_CXX_OBJECTS_DEFINITIONS "-DLIBLINPHONE_EXPORTS")
375 376
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS})

377
set(LINPHONE_PRIVATE_HEADER_FILES)
378
foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
379
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
380
endforeach ()
381 382 383
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
384
bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
385

Ghislain MARY's avatar
Ghislain MARY committed
386 387 388

if(ENABLE_STATIC)
	add_library(linphone-static STATIC ${LINPHONE_HEADER_FILES}
389
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
Ghislain MARY's avatar
Ghislain MARY committed
390
		$<TARGET_OBJECTS:linphone-coreapi-static>
391
	)
Ghislain MARY's avatar
Ghislain MARY committed
392 393 394 395 396 397 398 399 400 401 402 403 404
	set_target_properties(linphone-static PROPERTIES OUTPUT_NAME linphone)
	target_include_directories(linphone-static PUBLIC ${LINPHONE_INCLUDE_DIRS})
	target_link_libraries(linphone-static INTERFACE ${LIBS})
	if(APPLE)
		target_link_libraries(linphone-static INTERFACE "-framework Foundation" "-framework AVFoundation")
	endif()
	install(TARGETS linphone-static EXPORT ${EXPORT_TARGETS_NAME}Targets
		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
		PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
	)
endif()
if(ENABLE_SHARED)
	add_library(linphone SHARED "../share/cpim_grammar" ${LINPHONE_HEADER_FILES}
405
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
Ghislain MARY's avatar
Ghislain MARY committed
406
		$<TARGET_OBJECTS:linphone-coreapi>
407
	)
408
	#TODO: replace by if(APPLE) when we want to make apple framework on linphone-desktop too
Ghislain MARY's avatar
Ghislain MARY committed
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
	if(IOS)
		if(IOS)
			set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET})
		else()
			set(MIN_OS ${CMAKE_OSX_DEPLOYMENT_TARGET})
		endif()
		set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/osx/")
		set_target_properties(linphone PROPERTIES
			FRAMEWORK TRUE
			MACOSX_FRAMEWORK_IDENTIFIER org.linphone.linphone
			MACOSX_FRAMEWORK_INFO_PLIST Info.plist.in
			PUBLIC_HEADER "${LINPHONE_HEADER_FILES}"
			RESOURCE "../share/cpim_grammar"
		)
	endif()
	if(BELCARD_FOUND)
		if(APPLE)
			set_target_properties(linphone PROPERTIES LINK_FLAGS "-stdlib=libc++")
		endif()
	endif()

	set_target_properties(linphone PROPERTIES LINKER_LANGUAGE CXX)
	if(NOT ANDROID)
		# Do not version shared library on Android
		set_target_properties(linphone PROPERTIES SOVERSION ${LINPHONE_SO_VERSION})
	endif()
	target_include_directories(linphone PUBLIC ${LINPHONE_INCLUDE_DIRS})
	target_link_libraries(linphone PRIVATE ${LIBS})
	if(APPLE)
		target_link_libraries(linphone PRIVATE "-framework Foundation" "-framework AVFoundation")
	endif()
	if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
		set_target_properties(linphone PROPERTIES PREFIX "lib")
	elseif(ANDROID)
		target_link_libraries(linphone PUBLIC "log" ${SUPPORT_LIBRARIES} ${CPUFEATURES_LIBRARIES})
	endif()
	if(MSVC)
		if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
			install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/linphone.pdb
				DESTINATION ${CMAKE_INSTALL_BINDIR}
				PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
			)
		endif()
	endif()
	install(TARGETS linphone EXPORT ${EXPORT_TARGETS_NAME}Targets
		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
		FRAMEWORK DESTINATION Frameworks
		PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
	)
endif()
if(ICONV_FOUND)
	if(APPLE)
		# Prevent conflict between the system iconv.h header and the one from macports.
		if(ENABLE_STATIC)
			target_compile_options(linphone-static PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h")
		endif()
		if(ENABLE_SHARED)
			target_compile_options(linphone PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h")
		endif()
	else()
		if(ENABLE_STATIC)
			target_include_directories(linphone-static PRIVATE ${ICONV_INCLUDE_DIRS})
		endif()
		if(ENABLE_SHARED)
			target_include_directories(linphone PRIVATE ${ICONV_INCLUDE_DIRS})
		endif()
	endif()
endif()