config-ios.cmake 4.66 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 25
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
Ghislain MARY's avatar
Ghislain MARY committed
26
set(DEFAULT_VALUE_ENABLE_GSM ON)
Ghislain MARY's avatar
Ghislain MARY committed
27
set(DEFAULT_VALUE_ENABLE_ILBC ON)
28
set(DEFAULT_VALUE_ENABLE_ISAC ON)
29
set(DEFAULT_VALUE_ENABLE_MBEDTLS 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
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
36
set(DEFAULT_VALUE_ENABLE_VCARD ON)
37 38 39
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
40
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
41

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

44
# Global configuration
45
if(NOT LINPHONE_IOS_DEPLOYMENT_TARGET)
46 47
	set(LINPHONE_IOS_DEPLOYMENT_TARGET 6.0)
endif()
48
set(LINPHONE_BUILDER_HOST "${CMAKE_SYSTEM_PROCESSOR}-apple-darwin")
49
set(COMMON_FLAGS "-miphoneos-version-min=${LINPHONE_IOS_DEPLOYMENT_TARGET} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions")
50
set(LINPHONE_BUILDER_CPPFLAGS "${COMMON_FLAGS}")
51
set(LINPHONE_BUILDER_LDFLAGS "${COMMON_FLAGS}")
52 53
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)	# Restrict pkg-config to search in the install directory
unset(COMMON_FLAGS)
54
unset(LINPHONE_IOS_DEPLOYMENT_TARGET)
55

56
#XCode7 requires Cmake 3.3.20150815 at least
57 58 59
if(NOT ${XCODE_VERSION} VERSION_LESS 7)
	set(CMAKE_MIN_VERSION "3.3.20150815")
	if(${CMAKE_VERSION} VERSION_LESS ${CMAKE_MIN_VERSION})
60
		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.")
61 62
	endif()
endif()
63

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

67
linphone_builder_add_cmake_option(bzrtp "-DENABLE_STRICT=NO")
Ghislain MARY's avatar
Ghislain MARY committed
68

69
# ffmpeg
70
set(EP_ffmpeg_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
71

Ghislain MARY's avatar
Ghislain MARY committed
72
# linphone
73 74
linphone_builder_add_cmake_option(linphone "-DENABLE_RELATIVE_PREFIX=YES")
linphone_builder_add_cmake_option(linphone "-DENABLE_CONSOLE_UI=NO")
75
linphone_builder_add_cmake_option(linphone "-DENABLE_DAEMON=NO")
76 77 78 79 80 81
linphone_builder_add_cmake_option(linphone "-DENABLE_NOTIFY=NO")
linphone_builder_add_cmake_option(linphone "-DENABLE_TUTORIALS=NO")
linphone_builder_add_cmake_option(linphone "-DENABLE_UPNP=NO")
linphone_builder_add_cmake_option(linphone "-DENABLE_MSG_STORAGE=YES")
linphone_builder_add_cmake_option(linphone "-DENABLE_DOC=NO")
linphone_builder_add_cmake_option(linphone "-DENABLE_NLS=NO")
Ghislain MARY's avatar
Ghislain MARY committed
82

83
# mbedtls
84
set(EP_mbedtls_LINKING_TYPE "-DUSE_STATIC_MBEDTLS_LIBRARY=YES" "-DUSE_SHARED_MBEDTLS_LIBRARY=NO")
85

86
# mediastreamer2
87 88 89 90 91 92 93 94
linphone_builder_add_cmake_option(ms2 "-DENABLE_RELATIVE_PREFIX=YES")
linphone_builder_add_cmake_option(ms2 "-DENABLE_ALSA=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_PULSEAUDIO=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_OSS=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_GLX=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_X11=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_XV=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_DOC=NO")
Ghislain MARY's avatar
Ghislain MARY committed
95

96
# opus
97
linphone_builder_add_cmake_option(opus "-DENABLE_FIXED_POINT=YES")
98 99

# ortp
100
linphone_builder_add_cmake_option(ortp "-DENABLE_DOC=NO")
101 102 103 104 105

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

# speex
106 107
linphone_builder_add_cmake_option(speex "-DENABLE_FLOAT_API=NO")
linphone_builder_add_cmake_option(speex "-DENABLE_FIXED_POINT=YES")
108 109 110

# vpx
set(EP_vpx_LINKING_TYPE "--enable-static" "--disable-shared")
Ghislain MARY's avatar
Ghislain MARY committed
111 112 113 114

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