config-python.cmake 5.03 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
set(DEFAULT_VALUE_ENABLE_VPX ON)
37
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
38
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
Brieuc's avatar
Brieuc committed
39
set(DEFAULT_VALUE_ENABLE_LIME ON)
40
set(DEFAULT_VALUE_ENABLE_TOOLS OFF)
41
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
42

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


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

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


# 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)
57 58 59 60 61 62 63
		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()
64 65 66 67
		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()
68
		set(CMAKE_OSX_ARCHITECTURES "x86_64")
69

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


# Include builders
include(builders/CMakeLists.txt)


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

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

93
# linphone
94 95 96 97 98 99 100
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")
101

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

105
# ms2
106 107 108
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")
109
lcb_builder_cmake_options(ms2 "-DENABLE_GL=NO")
110
lcb_builder_cmake_options(ms2 "-DENABLE_THEORA=NO")
111
if(UNIX AND NOT APPLE)
112 113 114 115 116 117
	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")
118
endif()
119 120

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

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

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

129

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