config-ios.cmake 4.16 KB
Newer Older
Ghislain MARY's avatar
Ghislain MARY committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
############################################################################
# config-ios.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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
############################################################################

# Define default values for the linphone builder options
24 25 26
set(DEFAULT_VALUE_ENABLE_DTLS ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
Ghislain MARY's avatar
Ghislain MARY committed
27
set(DEFAULT_VALUE_ENABLE_GSM ON)
Ghislain MARY's avatar
Ghislain MARY committed
28
set(DEFAULT_VALUE_ENABLE_ILBC ON)
29
set(DEFAULT_VALUE_ENABLE_ISAC ON)
30
set(DEFAULT_VALUE_ENABLE_MKV ON)
Ghislain MARY's avatar
Ghislain MARY committed
31
set(DEFAULT_VALUE_ENABLE_OPUS ON)
Ghislain MARY's avatar
Ghislain MARY committed
32
set(DEFAULT_VALUE_ENABLE_SILK ON)
Ghislain MARY's avatar
Ghislain MARY committed
33
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
34 35 36 37 38 39
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)

40
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES")
Ghislain MARY's avatar
Ghislain MARY committed
41

42
# Global configuration
43 44 45
if (NOT LINPHONE_IOS_DEPLOYMENT_TARGET)
	set(LINPHONE_IOS_DEPLOYMENT_TARGET 6.0)
endif()
46
set(LINPHONE_BUILDER_HOST "${CMAKE_SYSTEM_PROCESSOR}-apple-darwin")
47 48
if("${PLATFORM}" MATCHES "Simulator")
	set(CLANG_TARGET_SPECIFIER "ios-simulator-version-min")
49
else()
50
	set(CLANG_TARGET_SPECIFIER "iphoneos-version-min")
51
endif()
Ghislain MARY's avatar
Ghislain MARY committed
52
set(COMMON_FLAGS "-m${CLANG_TARGET_SPECIFIER}=${LINPHONE_IOS_DEPLOYMENT_TARGET} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions")
53
set(LINPHONE_BUILDER_CPPFLAGS "${COMMON_FLAGS}")
54
set(LINPHONE_BUILDER_LDFLAGS "${COMMON_FLAGS}")
55 56 57
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)	# Restrict pkg-config to search in the install directory
unset(COMMON_FLAGS)
unset(CLANG_TARGET_SPECIFIER)
58
unset(LINPHONE_IOS_DEPLOYMENT_TARGET)
59

60 61 62 63
#XCode7 requires Cmake 3.3.20150815 at least
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
	set (CMAKE_MIN_VERSION "3.3.20150815")
	if (${CMAKE_VERSION} VERSION_LESS ${CMAKE_MIN_VERSION})
64
		message(FATAL_ERROR "You need at least CMake version ${CMAKE_MIN_VERSION} but you are currently using ${CMAKE_VERSION}. There is no Cmake release available for it yet, so you must either compile it manually or revert to XCode6 temporary.")
65 66
	endif()
endif()
67

Ghislain MARY's avatar
Ghislain MARY committed
68 69 70 71 72
# Include builders
include(builders/CMakeLists.txt)


# belle-sip
Ghislain MARY's avatar
Ghislain MARY committed
73
list(APPEND EP_bellesip_CMAKE_OPTIONS "-DENABLE_TESTS=NO")
Ghislain MARY's avatar
Ghislain MARY committed
74

Ghislain MARY's avatar
Ghislain MARY committed
75 76 77
# bzrtp
list(APPEND EP_bzrtp_CMAKE_OPTIONS "-DENABLE_TESTS=NO")

78
# ffmpeg
79
set(EP_ffmpeg_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
80

Ghislain MARY's avatar
Ghislain MARY committed
81
# linphone
82 83 84 85 86 87 88 89 90
list(APPEND EP_linphone_CMAKE_OPTIONS
	"-DENABLE_RELATIVE_PREFIX=YES"
	"-DENABLE_CONSOLE_UI=NO"
	"-DENABLE_GTK_UI=NO"
	"-DENABLE_NOTIFY=NO"
	"-DENABLE_TOOLS=NO"
	"-DENABLE_TUTORIALS=NO"
	"-DENABLE_UPNP=NO"
	"-DENABLE_MSG_STORAGE=YES"
91
	"-DENABLE_DOC=NO"
92
	"-DENABLE_UNIT_TESTS=YES"
93
	"-DENABLE_NLS=NO"
94
)
Ghislain MARY's avatar
Ghislain MARY committed
95

96
# mediastreamer2
97 98 99 100 101 102 103 104 105 106 107 108
list(APPEND EP_ms2_CMAKE_OPTIONS
	"-DENABLE_RELATIVE_PREFIX=YES"
	"-DENABLE_ALSA=NO"
	"-DENABLE_PULSEAUDIO=NO"
	"-DENABLE_OSS=NO"
	"-DENABLE_GLX=NO"
	"-DENABLE_X11=NO"
	"-DENABLE_XV=NO"
	"-DENABLE_TOOLS=NO"
	"-DENABLE_DOC=NO"
	"-DENABLE_UNIT_TESTS=NO"
)
Ghislain MARY's avatar
Ghislain MARY committed
109

110
# opus
Ghislain MARY's avatar
Ghislain MARY committed
111
list(APPEND EP_opus_CMAKE_OPTIONS "-DENABLE_FIXED_POINT=YES")
112 113

# ortp
Ghislain MARY's avatar
Ghislain MARY committed
114
list(APPEND EP_ortp_CMAKE_OPTIONS "-DENABLE_DOC=NO")
115 116 117 118 119

# polarssl
set(EP_polarssl_LINKING_TYPE "-DUSE_SHARED_POLARSSL_LIBRARY=0")

# speex
Ghislain MARY's avatar
Ghislain MARY committed
120
list(APPEND EP_speex_CMAKE_OPTIONS "-DENABLE_FLOAT_API=NO" "-DENABLE_FIXED_POINT=YES")
121 122 123

# vpx
set(EP_vpx_LINKING_TYPE "--enable-static" "--disable-shared")
Ghislain MARY's avatar
Ghislain MARY committed
124 125 126 127 128

# x264
set(EP_x264_LINKING_TYPE "--enable-static" "--enable-pic")
set(EP_x264_INSTALL_TARGET "install-lib-static")