config-python.cmake 4.78 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 35
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
Ghislain MARY's avatar
Ghislain MARY committed
36
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
37
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
38
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
39
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
40

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


find_package(Doxygen REQUIRED)
45
find_package(PythonInterp REQUIRED)
46 47 48 49 50 51 52


# 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)
53 54 55 56 57 58 59
		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()
60 61 62 63
		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()
64
		set(CMAKE_OSX_ARCHITECTURES "x86_64")
65

66 67 68
		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}")
69
	else()
70
		set(LINPHONE_BUILDER_CPPFLAGS "-fPIC")
71
		set(LINPHONE_BUILDER_LDFLAGS "-Wl,-Bsymbolic -fPIC")
72 73 74
	endif()
endif()
if(WIN32)
75
	set(LINPHONE_BUILDER_CPPFLAGS "-D_WIN32_WINNT=0x0501 -D_ALLOW_KEYWORD_MACROS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS")
76 77 78 79 80 81 82
endif()


# Include builders
include(builders/CMakeLists.txt)


83
# bctoolbox
84
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS_COMPONENT=NO")
85

86
# ffmpeg
Ghislain MARY's avatar
Ghislain MARY committed
87
lcb_builder_linking_type(ffmpeg "--disable-static" "--enable-shared")
88

89
# linphone
90 91 92 93 94 95 96
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")
97

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

101
# ms2
102 103 104
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")
105
if(UNIX AND NOT APPLE)
106 107 108 109 110 111
	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")
112
endif()
113 114

# polarssl
Ghislain MARY's avatar
Ghislain MARY committed
115
lcb_builder_linking_type(polarssl "-DUSE_SHARED_POLARSSL_LIBRARY=NO")
116 117

# v4l
Ghislain MARY's avatar
Ghislain MARY committed
118
lcb_builder_linking_type(v4l "--enable-static" "--disable-shared" "--with-pic")
119 120

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

123

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