config-python.cmake 4.95 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# config-python.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.
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)
26
set(DEFAULT_VALUE_ENABLE_GSM ON)
27
set(DEFAULT_VALUE_ENABLE_G729 ${DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES})
28
set(DEFAULT_VALUE_ENABLE_G729B_CNG OFF)
29
set(DEFAULT_VALUE_ENABLE_MBEDTLS ON)
30
set(DEFAULT_VALUE_ENABLE_MKV ON)
31 32
set(DEFAULT_VALUE_ENABLE_OPUS ON)
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
33 34
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
35
set(DEFAULT_VALUE_ENABLE_VCARD ON)
36 37
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
Brieuc Viel's avatar
Brieuc Viel committed
38
set(DEFAULT_VALUE_ENABLE_LIME ON)
39
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
40
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
41

42
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES" "-DENABLE_SHARED=NO")
43 44


45 46
set(LINPHONE_BUILDER_PYTHON_VERSION "2.7" CACHE STRING "Python version to target")

47
find_package(Doxygen REQUIRED)
48
find_package(PythonInterp REQUIRED)
49 50 51 52 53 54 55


# Global configuration
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)	# Restrict pkg-config to search in the install directory

if (UNIX)
	if(APPLE)
56 57 58 59 60 61 62
		if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
			execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/configs/python/mac_getplatform.py"
				OUTPUT_VARIABLE MAC_PLATFORM
				OUTPUT_STRIP_TRAILING_WHITESPACE
			)
			list(GET MAC_PLATFORM 0 CMAKE_OSX_DEPLOYMENT_TARGET)
		endif()
63 64 65 66
		if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.8")
			# Resolve conflict between c++ libraries when building C++11 libraries on Mac OS X 10.7
			set(LINPHONE_BUILDER_CXXFLAGS "-stdlib=libc++")
		endif()
67
		set(CMAKE_OSX_ARCHITECTURES "x86_64")
68

69 70 71
		set(LINPHONE_BUILDER_CPPFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
		set(LINPHONE_BUILDER_OBJCFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
		set(LINPHONE_BUILDER_LDFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
72
	else()
73
		set(LINPHONE_BUILDER_CPPFLAGS "-fPIC")
74
		set(LINPHONE_BUILDER_LDFLAGS "-Wl,-Bsymbolic -fPIC")
75 76 77
	endif()
endif()
if(WIN32)
78
	set(LINPHONE_BUILDER_CPPFLAGS "-D_WIN32_WINNT=0x0501 -D_ALLOW_KEYWORD_MACROS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS")
79 80 81 82 83 84 85
endif()


# Include builders
include(builders/CMakeLists.txt)


86
# bctoolbox
87
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS_COMPONENT=NO")
88

89
# ffmpeg
Ghislain MARY's avatar
Ghislain MARY committed
90
lcb_builder_linking_type(ffmpeg "--disable-static" "--enable-shared")
91

92
# linphone
93 94 95 96 97 98 99
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_UNIT_TESTS=NO")
lcb_builder_cmake_options(linphone "-DENABLE_UPNP=NO")
100

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

104
# ms2
105 106 107
lcb_builder_cmake_options(ms2 "-DENABLE_RELATIVE_PREFIX=YES")
lcb_builder_cmake_options(ms2 "-DENABLE_UNIT_TESTS=NO")
lcb_builder_cmake_options(ms2 "-DENABLE_PCAP=NO")
108
lcb_builder_cmake_options(ms2 "-DENABLE_GL=NO")
109
if(UNIX AND NOT APPLE)
110 111 112 113 114 115
	lcb_builder_cmake_options(ms2 "-DENABLE_ALSA=YES")
	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=YES")
	lcb_builder_cmake_options(ms2 "-DENABLE_XV=YES")
116
endif()
117 118

# polarssl
Ghislain MARY's avatar
Ghislain MARY committed
119
lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=NO")
120 121

# v4l
Ghislain MARY's avatar
Ghislain MARY committed
122
lcb_builder_linking_type(v4l "--enable-static" "--disable-shared" "--with-pic")
123 124

# vpx
Ghislain MARY's avatar
Ghislain MARY committed
125
lcb_builder_linking_type(vpx "--enable-static" "--disable-shared" "--enable-pic")
126

127

128 129
# Add config step to build the Python module
set(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS "${CMAKE_CURRENT_LIST_DIR}/python/additional_steps.cmake")