CMakeLists.txt 4.39 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# CMakeLists.txt
# Copyright (C) 2014  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
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 21 22
#
############################################################################

23
list(APPEND LINPHONE_PRIVATE_HEADER_FILES
24
	bellesip_sal/sal_impl.h
25 26 27
	carddav.h
	conference_private.h
	contact_providers_priv.h
28
	core_private.h
29 30 31 32
	enum.h
	lime.h
	lpc2xml.h
	offeranswer.h
33
	private.h
34 35 36 37
	quality_reporting.h
	sqlite3_bctbx_vfs.h
	vcard_private.h
	xml2lpc.h
38 39
)

40
set(LINPHONE_SOURCE_FILES_C
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
	account_creator.c
	account_creator_service.c
	authentication.c
	bellesip_sal/sal_address_impl.c
	bellesip_sal/sal_impl.c
	bellesip_sal/sal_op_impl.c
	bellesip_sal/sal_sdp.c
	buffer.c
	callbacks.c
	call_log.c
	carddav.c
	chat.c
	contactprovider.c
	dict.c
	ec-calibrator.c
	echo-tester.c
	enum.c
	error_info.c
	event.c
	factory.c
	friend.c
	friendlist.c
	im_notif_policy.c
	info.c
	ldapprovider.c
	lime.c
	im_encryption_engine.c
	linphonecall.c
	linphonecore.c
	linphone_tunnel_config.c
	localplayer.c
72
	logging.c
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
	lpc2xml.c
	lpconfig.c
	lsd.c
	misc.c
	nat_policy.c
	offeranswer.c
	payload_type.c
	player.c
	presence.c
	proxy.c
	quality_reporting.c
	remote_provisioning.c
	ringtoneplayer.c
	siplogin.c
	sipsetup.c
	sqlite3_bctbx_vfs.c
	video_definition.c
	xml2lpc.c
	xml.c
	xmlrpc.c
	vtables.c
94
)
Ronan's avatar
Ronan committed
95 96
set(LINPHONE_SOURCE_FILES_CXX
	conference.cc
97
	tester_utils.cpp
Ronan's avatar
Ronan committed
98
)
99

100 101
if(ENABLE_JAVA_WRAPPER)
	list(APPEND LINPHONE_SOURCE_FILES_CXX ${LINPHONE_JNI_SOURCES})
102
	set_source_files_properties(${LINPHONE_JNI_SOURCES} PROPERTIES GENERATED TRUE)
103
else()
104 105 106
	if(ANDROID)
		list(APPEND LINPHONE_SOURCE_FILES_C linphonecore_jni.cc)
	endif()
107
endif()
108

109 110 111
set(LINPHONE_SOURCE_FILES_OBJC)
if (IOS)
	list(APPEND LINPHONE_SOURCE_FILES_OBJC ringtoneplayer_ios.m ringtoneplayer_ios.h)
112
	list(APPEND LINPHONE_SOURCE_FILES_CXX linphonecore_ios.cc)
113 114
endif()

115

116
if(ENABLE_TUNNEL)
117
	list(APPEND LINPHONE_SOURCE_FILES_CXX
118
		linphone_tunnel.cc
119 120 121
		TunnelManager.cc
	)
	add_definitions(-DTUNNEL_ENABLED)
122
else()
123
	list(APPEND LINPHONE_SOURCE_FILES_C linphone_tunnel_stubs.c)
124 125
endif()

126
if(BELCARD_FOUND)
127
	list(APPEND LINPHONE_SOURCE_FILES_CXX vcard.cc)
128 129 130
	if(NOT MSVC)
		list(APPEND STRICT_OPTIONS_CXX "-std=c++11")
	endif()
131
else()
132
	list(APPEND LINPHONE_SOURCE_FILES_C vcard_stubs.c)
133
endif()
134

Ghislain MARY's avatar
Ghislain MARY committed
135 136 137 138 139 140

bc_git_version(liblinphone ${PROJECT_VERSION})

add_definitions(
	-DUSE_BELLESIP
	-DBCTBX_LOG_DOMAIN="liblinphone"
141
	-DLINPHONE_EXPORTS
Ghislain MARY's avatar
Ghislain MARY committed
142 143
)

144 145
set_source_files_properties(${LINPHONE_SOURCE_FILES_C} PROPERTIES LANGUAGE CXX)
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
146 147
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
148

Ghislain MARY's avatar
Ghislain MARY committed
149 150 151 152

if (ENABLE_STATIC)
	add_library(linphone-coreapi-static OBJECT
		${LINPHONE_PRIVATE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}
153
	)
Ghislain MARY's avatar
Ghislain MARY committed
154 155
	target_include_directories(linphone-coreapi-static SYSTEM PRIVATE ${LINPHONE_INCLUDE_DIRS})
	add_dependencies(linphone-coreapi-static liblinphone-git-version)
156 157 158
	if (ENABLE_JAVA_WRAPPER)
		add_dependencies(linphone-coreapi-static linphonej)
	endif()
Ghislain MARY's avatar
Ghislain MARY committed
159
endif ()
160

Ghislain MARY's avatar
Ghislain MARY committed
161 162 163
if (ENABLE_SHARED)
	add_library(linphone-coreapi OBJECT
		${LINPHONE_PRIVATE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}
164
	)
Ghislain MARY's avatar
Ghislain MARY committed
165 166 167
	target_include_directories(linphone-coreapi SYSTEM PRIVATE ${LINPHONE_INCLUDE_DIRS})
	target_compile_options(linphone-coreapi PRIVATE "-fPIC")
	add_dependencies(linphone-coreapi liblinphone-git-version)
168 169 170
	if (ENABLE_JAVA_WRAPPER)
        add_dependencies(linphone-coreapi linphonej)
    endif()
Ghislain MARY's avatar
Ghislain MARY committed
171 172
endif ()

173

174
add_subdirectory(help)