config-ios.cmake 5.13 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 24 25
include(${CMAKE_CURRENT_LIST_DIR}/options-ios.cmake)


26
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_SHARED=NO" "-DENABLE_STATIC=YES")
27 28


29 30
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")
31

32
# Global configuration
33
if(NOT LINPHONE_IOS_DEPLOYMENT_TARGET)
Benjamin REIS's avatar
Benjamin REIS committed
34
	set(LINPHONE_IOS_DEPLOYMENT_TARGET 8.0)
35
endif()
36
set(LINPHONE_BUILDER_HOST "${CMAKE_SYSTEM_PROCESSOR}-apple-darwin")
37
set(COMMON_FLAGS "-miphoneos-version-min=${LINPHONE_IOS_DEPLOYMENT_TARGET} -fms-extensions")
38
set(LINPHONE_BUILDER_CPPFLAGS "${COMMON_FLAGS}")
39
set(LINPHONE_BUILDER_LDFLAGS "${COMMON_FLAGS}")
40 41 42
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)	# Restrict pkg-config to search in the install directory
unset(COMMON_FLAGS)

43
message(STATUS "Xcode version: ${XCODE_VERSION}")
44

45 46 47 48
#Framework generation requires cmake 3.6 at least, otherwise it is completely broken.
set(CMAKE_MIN_VERSION "3.6.1")
if(${CMAKE_VERSION} VERSION_LESS ${CMAKE_MIN_VERSION})
	message(FATAL_ERROR "CMake with version greater than ${CMAKE_MIN_VERSION} is required but you are currently using ${CMAKE_VERSION}.")
49
endif()
50

51 52
set(LINPHONE_BUILDER_CXXFLAGS "${LINPHONE_BUILDER_CXXFLAGS} -stdlib=libc++")
set(LINPHONE_BUILDER_LDFLAGS "${LINPHONE_BUILDER_LDFLAGS} -stdlib=libc++")
jehan's avatar
jehan committed
53

Ghislain MARY's avatar
Ghislain MARY committed
54 55 56
# Include builders
include(builders/CMakeLists.txt)

57
# bctoolbox
58 59 60 61
lcb_builder_linking_type(bctoolbox "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")

# belcard
lcb_builder_linking_type(belcard "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
62

63 64
# belr
lcb_builder_linking_type(belr "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
65

66 67 68 69 70
# ffmpeg
lcb_builder_linking_type(ffmpeg "--enable-static" "--disable-shared" "--enable-pic")

# lime
lcb_builder_linking_type(lime "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
71

Ghislain MARY's avatar
Ghislain MARY committed
72
# linphone
Ghislain MARY's avatar
Ghislain MARY committed
73 74 75 76 77 78 79 80 81
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")
82
lcb_builder_linking_type(linphone "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
Ghislain MARY's avatar
Ghislain MARY committed
83

84
# mbedtls
Ghislain MARY's avatar
Ghislain MARY committed
85
lcb_builder_linking_type(mbedtls "-DUSE_STATIC_MBEDTLS_LIBRARY=YES" "-DUSE_SHARED_MBEDTLS_LIBRARY=NO")
86

87
# mediastreamer2
Ghislain MARY's avatar
Ghislain MARY committed
88 89 90 91 92 93 94 95
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")
96
lcb_builder_linking_type(ms2 "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
97

98 99 100 101 102 103 104
# ms2 plugins
lcb_builder_linking_type(msamr "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
lcb_builder_linking_type(mscodec2 "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
lcb_builder_linking_type(msopenh264 "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
lcb_builder_linking_type(mssilk "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
lcb_builder_linking_type(mswebrtc "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
lcb_builder_linking_type(msx264 "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
Ghislain MARY's avatar
Ghislain MARY committed
105

106
# opus
Ghislain MARY's avatar
Ghislain MARY committed
107
lcb_builder_cmake_options(opus "-DENABLE_FIXED_POINT=YES")
108 109

# ortp
Ghislain MARY's avatar
Ghislain MARY committed
110
lcb_builder_cmake_options(ortp "-DENABLE_DOC=NO")
111
lcb_builder_linking_type(ortp "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
112 113

# polarssl
Ghislain MARY's avatar
Ghislain MARY committed
114
lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=0")
115

Benjamin REIS's avatar
Benjamin REIS committed
116 117 118
# soci
lcb_builder_linking_type(soci "-DSOCI_STATIC=YES" "-DSOCI_SHARED=NO")

119
# speex
Ghislain MARY's avatar
Ghislain MARY committed
120 121
lcb_builder_cmake_options(speex "-DENABLE_FLOAT_API=NO")
lcb_builder_cmake_options(speex "-DENABLE_FIXED_POINT=YES")
122

123 124 125
# srtp
lcb_builder_linking_type(srtp "-DENABLE_STATIC=YES")

126
# vpx
Ghislain MARY's avatar
Ghislain MARY committed
127
lcb_builder_linking_type(vpx "--enable-static" "--disable-shared")
Ghislain MARY's avatar
Ghislain MARY committed
128 129

# x264
Ghislain MARY's avatar
Ghislain MARY committed
130 131
lcb_builder_linking_type(x264 "--enable-static" "--enable-pic")
lcb_builder_install_target(x264 "install-lib-static")
Benjamin Verdier's avatar
Benjamin Verdier committed
132