config-webplugin.cmake 4.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# config-webplugin.cmake
# 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
#
############################################################################

# Define default values for the linphone builder options
24 25
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
26
set(DEFAULT_VALUE_ENABLE_OPUS ON)
27
set(DEFAULT_VALUE_ENABLE_POLARSSL ON)
28
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
29 30 31
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
Ghislain MARY's avatar
Ghislain MARY committed
32
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
33
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
34

35
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
36

Ghislain MARY's avatar
Ghislain MARY committed
37

38 39 40 41 42
# Global configuration
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)	# Restrict pkg-config to search in the install directory

if (UNIX)
	if(APPLE)
43 44 45 46 47 48 49
		if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
			set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
		endif()
		if(NOT CMAKE_OSX_ARCHITECTURES)
			set(CMAKE_OSX_ARCHITECTURES "i386")
		endif()
		set(LINPHONE_BUILDER_HOST "${CMAKE_OSX_ARCHITECTURES}-apple-darwin")
50
		set(LINPHONE_BUILDER_CPPFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
51
		set(LINPHONE_BUILDER_OBJCFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
52 53
		set(LINPHONE_BUILDER_LDFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
	else()
54
		set(LINPHONE_BUILDER_LDFLAGS "-Wl,-Bsymbolic")
55 56 57 58 59 60 61
	endif()
endif()
if(WIN32)
	set(LINPHONE_BUILDER_CPPFLAGS "-D_WIN32_WINNT=0x0501 -D_ALLOW_KEYWORD_MACROS")
endif()


Ghislain MARY's avatar
Ghislain MARY committed
62 63
# Include builders
include(builders/CMakeLists.txt)
64 65


66
# belle-sip
67
lcb_builder_cmake_options(bellesip "-DENABLE_SERVER_SOCKETS=0")
68

69 70 71
# gsm
set(EP_gsm_LINKING_TYPE "-DENABLE_STATIC=YES")

72
# linphone
73 74 75 76 77 78 79 80
lcb_builder_cmake_options(linphone "-DENABLE_RELATIVE_PREFIX=YES")
lcb_builder_cmake_options(linphone "-DENABLE_CONSOLE_UI=NO")
lcb_builder_cmake_options(linphone "-DENABLE_DAEMON=NO")
lcb_builder_cmake_options(linphone "-DENABLE_NOTIFY=NO")
lcb_builder_cmake_options(linphone "-DENABLE_TUTORIALS=NO")
lcb_builder_cmake_options(linphone "-DENABLE_UNIT_TESTS=NO")
lcb_builder_cmake_options(linphone "-DENABLE_UPNP=NO")
lcb_builder_cmake_options(linphone "-DENABLE_NLS=NO")
81
if(MSVC)
82
	lcb_builder_cmake_options(linphone "-DENABLE_TOOLS=NO")
83
else()
84
	lcb_builder_cmake_options(linphone "-DENABLE_TOOLS=YES")
85
endif()
86 87

# mediastreamer2
88 89
lcb_builder_cmake_options(ms2 "-DENABLE_RELATIVE_PREFIX=YES")
lcb_builder_cmake_options(ms2 "-DENABLE_UNIT_TESTS=NO")
90
if(UNIX AND NOT APPLE)
91 92 93 94 95 96
	lcb_builder_cmake_options(ms2 "-DENABLE_ALSA=YES")
	lcb_builder_cmake_options(ms2 "-DENABLE_PULSEAUDIO=NO")
	lcb_builder_cmake_options(ms2 "-DENABLE_OSS=NO")
	lcb_builder_cmake_options(ms2 "-DENABLE_GLX=NO")
	lcb_builder_cmake_options(ms2 "-DENABLE_X11=YES")
	lcb_builder_cmake_options(ms2 "-DENABLE_XV=YES")
97
endif()
98

99
# opencoreamr
100 101 102 103 104
if(NOT WIN32)
	set(EP_opencoreamr_EXTRA_CFLAGS "${EP_opencoreamr_EXTRA_CFLAGS} -fPIC")
	set(EP_opencoreamr_EXTRA_CXXFLAGS "${EP_opencoreamr_EXTRA_CXXFLAGS} -fPIC")
	set(EP_opencoreamr_EXTRA_LDFLAGS "${EP_opencoreamr_EXTRA_LDFLAGS} -fPIC")
endif()
105

106
# opus
107
set(EP_opus_LINKING_TYPE "-DENABLE_STATIC=YES")
108

Ghislain MARY's avatar
Ghislain MARY committed
109
# sqlite3
110
set(EP_sqlite3_LINKING_TYPE "-DENABLE_STATIC=YES")
Ghislain MARY's avatar
Ghislain MARY committed
111

112 113 114
# v4l
set(EP_v4l_LINKING_TYPE "--enable-static" "--disable-shared" "--with-pic")

115
# voamrwbenc
116 117 118 119 120
if(NOT WIN32)
	set(EP_voamrwbenc_EXTRA_CFLAGS "${EP_voamrwbenc_EXTRA_CFLAGS} -fPIC")
	set(EP_voamrwbenc_EXTRA_CXXFLAGS "${EP_voamrwbenc_EXTRA_CXXFLAGS} -fPIC")
	set(EP_voamrwbenc_EXTRA_LDFLAGS "${EP_voamrwbenc_EXTRA_LDFLAGS} -fPIC")
endif()
121

122
# vpx
123
set(EP_vpx_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
124

125
# xml2
126
set(EP_xml2_LINKING_TYPE "-DENABLE_STATIC=YES")