config-ios.cmake 5.89 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
############################################################################
# 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
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
Ghislain MARY's avatar
Ghislain MARY committed
20 21 22 23
#
############################################################################

# Define default values for the linphone builder options
24
set(DEFAULT_VALUE_ENABLE_FFMPEG OFF)
25
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
Ghislain MARY's avatar
Ghislain MARY committed
26
set(DEFAULT_VALUE_ENABLE_GSM ON)
27
set(DEFAULT_VALUE_ENABLE_ILBC ON)
28
set(DEFAULT_VALUE_ENABLE_ISAC ON)
29
set(DEFAULT_VALUE_ENABLE_JPEG ON)
30
set(DEFAULT_VALUE_ENABLE_MBEDTLS ON)
31
set(DEFAULT_VALUE_ENABLE_MKV ON)
Ghislain MARY's avatar
Ghislain MARY committed
32
set(DEFAULT_VALUE_ENABLE_OPUS ON)
33
set(DEFAULT_VALUE_ENABLE_SILK ON)
Ghislain MARY's avatar
Ghislain MARY committed
34
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
35
set(DEFAULT_VALUE_ENABLE_G729 ${DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES})
36
set(DEFAULT_VALUE_ENABLE_G729B_CNG OFF)
37
set(DEFAULT_VALUE_ENABLE_SRTP ON)
38
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS OFF) #link of binary significantly slow down compilation.
39
set(DEFAULT_VALUE_ENABLE_VCARD ON)
40 41 42
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
Brieuc Viel's avatar
Brieuc Viel committed
43
set(DEFAULT_VALUE_ENABLE_LIME ON)
44
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
45
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
46 47
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
48

49
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES" "-DENABLE_SHARED=NO")
Ghislain MARY's avatar
Ghislain MARY committed
50

51
# Global configuration
52
if(NOT LINPHONE_IOS_DEPLOYMENT_TARGET)
53 54
	set(LINPHONE_IOS_DEPLOYMENT_TARGET 6.0)
endif()
55
set(LINPHONE_BUILDER_HOST "${CMAKE_SYSTEM_PROCESSOR}-apple-darwin")
56
set(COMMON_FLAGS "-miphoneos-version-min=${LINPHONE_IOS_DEPLOYMENT_TARGET} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions")
57
set(LINPHONE_BUILDER_CPPFLAGS "${COMMON_FLAGS}")
58
set(LINPHONE_BUILDER_LDFLAGS "${COMMON_FLAGS}")
59 60
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)	# Restrict pkg-config to search in the install directory
unset(COMMON_FLAGS)
61
unset(LINPHONE_IOS_DEPLOYMENT_TARGET)
62

63
#XCode7 requires Cmake 3.3.20150815 at least
64 65 66
if(NOT ${XCODE_VERSION} VERSION_LESS 7)
	set(CMAKE_MIN_VERSION "3.3.20150815")
	if(${CMAKE_VERSION} VERSION_LESS ${CMAKE_MIN_VERSION})
67
		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.")
68 69
	endif()
endif()
70

71 72
set(LINPHONE_BUILDER_CXXFLAGS "${LINPHONE_BUILDER_CXXFLAGS} -stdlib=libc++")
set(LINPHONE_BUILDER_LDFLAGS "${LINPHONE_BUILDER_LDFLAGS} -stdlib=libc++")
73

Ghislain MARY's avatar
Ghislain MARY committed
74 75 76
# Include builders
include(builders/CMakeLists.txt)

77
# ffmpeg
Ghislain MARY's avatar
Ghislain MARY committed
78
lcb_builder_linking_type(ffmpeg "--enable-static" "--disable-shared" "--enable-pic")
79

80
# bctoolbox
81 82 83
if(NOT ENABLE_STATIC_ONLY)
	lcb_builder_linking_type(bctoolbox "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
endif()
84

Ghislain MARY's avatar
Ghislain MARY committed
85
# linphone
86 87 88 89 90 91 92 93 94
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_UPNP=NO")
lcb_builder_cmake_options(linphone "-DENABLE_MSG_STORAGE=YES")
lcb_builder_cmake_options(linphone "-DENABLE_DOC=NO")
lcb_builder_cmake_options(linphone "-DENABLE_NLS=NO")
95 96 97
if(NOT ENABLE_STATIC_ONLY)
	lcb_builder_linking_type(linphone "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
endif()
Ghislain MARY's avatar
Ghislain MARY committed
98

99
# mbedtls
Ghislain MARY's avatar
Ghislain MARY committed
100
lcb_builder_linking_type(mbedtls "-DUSE_STATIC_MBEDTLS_LIBRARY=YES" "-DUSE_SHARED_MBEDTLS_LIBRARY=NO")
101

102
# mediastreamer2
103 104 105 106 107 108 109 110
lcb_builder_cmake_options(ms2 "-DENABLE_RELATIVE_PREFIX=YES")
lcb_builder_cmake_options(ms2 "-DENABLE_ALSA=NO")
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=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_XV=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_DOC=NO")
111 112 113 114 115 116 117 118 119 120
if(NOT ENABLE_STATIC_ONLY)
	lcb_builder_linking_type(ms2 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
	## ms2 plugins
	lcb_builder_linking_type(mswebrtc "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
	lcb_builder_linking_type(msamr "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
	lcb_builder_linking_type(mscodec2 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
	lcb_builder_linking_type(msopenh264 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
	lcb_builder_linking_type(mssilk "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
	lcb_builder_linking_type(msx264 "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
endif()
121

122
# opus
123
lcb_builder_cmake_options(opus "-DENABLE_FIXED_POINT=YES")
124 125

# ortp
126
lcb_builder_cmake_options(ortp "-DENABLE_DOC=NO")
127 128 129
if(NOT ENABLE_STATIC_ONLY)
	lcb_builder_linking_type(ortp "-DENABLE_STATIC=NO" "-DENABLE_SHARED=YES")
endif()
130 131

# polarssl
Ghislain MARY's avatar
Ghislain MARY committed
132
lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=0")
133 134

# speex
135 136
lcb_builder_cmake_options(speex "-DENABLE_FLOAT_API=NO")
lcb_builder_cmake_options(speex "-DENABLE_FIXED_POINT=YES")
137 138

# vpx
Ghislain MARY's avatar
Ghislain MARY committed
139
lcb_builder_linking_type(vpx "--enable-static" "--disable-shared")
140 141

# x264
Ghislain MARY's avatar
Ghislain MARY committed
142 143
lcb_builder_linking_type(x264 "--enable-static" "--enable-pic")
lcb_builder_install_target(x264 "install-lib-static")