CMakeLists.txt 16.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
############################################################################
# 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 70 71
#define log domain for this part of code
add_definitions(-DBCTBX_LOG_DOMAIN="liblinphone")

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

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

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

372 373 374 375 376 377
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS
	${BELR_INCLUDE_DIRS}
	${LIBXSD_INCLUDE_DIRS}
	${SOCI_INCLUDE_DIRS}
	${SOCI_MYSQL_INCLUDES}
)
378 379
set(LINPHONE_CXX_OBJECTS_INCLUDE_DIRS ${BELR_INCLUDE_DIRS})

380
set(LINPHONE_PRIVATE_HEADER_FILES)
381
foreach (header ${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES})
382
	list(APPEND LINPHONE_PRIVATE_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
383
endforeach ()
384 385
set(LINPHONE_PRIVATE_HEADER_FILES ${LINPHONE_PRIVATE_HEADER_FILES} PARENT_SCOPE)

386 387 388
if (ANDROID AND CMAKE_C_COMPILER_ID STREQUAL "GNU") 
	list(APPEND STRICT_OPTIONS_CXX "-Wno-attributes")
endif()
389
bc_apply_compile_flags(LINPHONE_CXX_OBJECTS_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
Benjamin REIS's avatar
Benjamin REIS committed
390
bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
391

Ghislain MARY's avatar
Ghislain MARY committed
392 393 394

if(ENABLE_STATIC)
	add_library(linphone-static STATIC ${LINPHONE_HEADER_FILES}
395
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
Ghislain MARY's avatar
Ghislain MARY committed
396
		$<TARGET_OBJECTS:linphone-coreapi-static>
397
	)
Ghislain MARY's avatar
Ghislain MARY committed
398 399 400 401 402 403 404 405 406 407 408 409
	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)
jehan's avatar
jehan committed
410
	set(LINPHONE_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../share/cpim_grammar") #keep it relative to current dir to allow CMakeList inclusion
411
	add_library(linphone SHARED ${LINPHONE_RESOURCES} ${LINPHONE_HEADER_FILES}
412
		${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
Ghislain MARY's avatar
Ghislain MARY committed
413
		$<TARGET_OBJECTS:linphone-coreapi>
414
	)
François Grisez's avatar
François Grisez committed
415
	target_compile_definitions(linphone PRIVATE "-DLINPHONE_EXPORTS")
416
	#TODO: replace by if(APPLE) when we want to make apple framework on linphone-desktop too
Ghislain MARY's avatar
Ghislain MARY committed
417 418 419 420 421 422 423 424 425 426 427
	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
428
			RESOURCE ${LINPHONE_RESOURCES}
Ghislain MARY's avatar
Ghislain MARY committed
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
		)
	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()
447
	if(WIN32)
448
		# Export Xerces and Soci symbols.
449
		target_compile_definitions(linphone PRIVATE "-DDLL_EXPORT" "-DSOCI_DLL")
450 451 452
		if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
			set_target_properties(linphone PROPERTIES PREFIX "lib")
		endif()
Ghislain MARY's avatar
Ghislain MARY committed
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
	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()
472

Ghislain MARY's avatar
Ghislain MARY committed
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
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()