config-ios.cmake 5.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
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 36 37 38
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)
39
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
40

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

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

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

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

66
# bctoolbox
67
linphone_builder_add_cmake_option(bctoolbox "-DENABLE_TESTS=NO")
Ghislain MARY's avatar
Ghislain MARY committed
68 69

# belle-sip
70
linphone_builder_add_cmake_option(bellesip "-DENABLE_TESTS=NO")
Ghislain MARY's avatar
Ghislain MARY committed
71

Ghislain MARY's avatar
Ghislain MARY committed
72
# bzrtp
73 74
linphone_builder_add_cmake_option(bzrtp "-DENABLE_TESTS=NO")
linphone_builder_add_cmake_option(bzrtp "-DENABLE_STRICT=NO")
Ghislain MARY's avatar
Ghislain MARY committed
75

76
# ffmpeg
77
set(EP_ffmpeg_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
78

Ghislain MARY's avatar
Ghislain MARY committed
79
# linphone
80 81
linphone_builder_add_cmake_option(linphone "-DENABLE_RELATIVE_PREFIX=YES")
linphone_builder_add_cmake_option(linphone "-DENABLE_CONSOLE_UI=NO")
82
linphone_builder_add_cmake_option(linphone "-DENABLE_DAEMON=NO")
83 84 85 86 87 88 89 90 91
linphone_builder_add_cmake_option(linphone "-DENABLE_GTK_UI=NO")
linphone_builder_add_cmake_option(linphone "-DENABLE_NOTIFY=NO")
linphone_builder_add_cmake_option(linphone "-DENABLE_TOOLS=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_UNIT_TESTS=YES")
linphone_builder_add_cmake_option(linphone "-DENABLE_NLS=NO")
Ghislain MARY's avatar
Ghislain MARY committed
92

93
# mbedtls
94
set(EP_mbedtls_LINKING_TYPE "-DUSE_STATIC_MBEDTLS_LIBRARY=YES" "-DUSE_SHARED_MBEDTLS_LIBRARY=NO")
95

96
# mediastreamer2
97 98 99 100 101 102 103 104 105
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_TOOLS=NO")
linphone_builder_add_cmake_option(ms2 "-DENABLE_DOC=NO")
106
linphone_builder_add_cmake_option(ms2 "-DENABLE_UNIT_TESTS=YES")
Ghislain MARY's avatar
Ghislain MARY committed
107

108
# opus
109
linphone_builder_add_cmake_option(opus "-DENABLE_FIXED_POINT=YES")
110 111

# ortp
112
linphone_builder_add_cmake_option(ortp "-DENABLE_DOC=NO")
113 114 115 116 117

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

# speex
118 119
linphone_builder_add_cmake_option(speex "-DENABLE_FLOAT_API=NO")
linphone_builder_add_cmake_option(speex "-DENABLE_FIXED_POINT=YES")
120 121 122

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

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