Commit 8d78f930 authored by Ghislain MARY's avatar Ghislain MARY

Add build options for unit tests and start handling the build options.

parent 74fa7a3b
......@@ -29,42 +29,15 @@ set(LINPHONE_BUILDER_TOOLCHAIN "desktop" CACHE STRING "Toolchain to use for the
include(cmake/LinphoneCMakeBuilder.cmake)
# Include toolchain definition if needed
# Include toolchain definition
message("-- Using toolchain '${LINPHONE_BUILDER_TOOLCHAIN}'")
include(toolchains/toolchain-${LINPHONE_BUILDER_TOOLCHAIN}.cmake)
linphone_builder_apply_toolchain_flags()
# Include project configuration according to the toolchain
include(configs/config-default.cmake)
include(configs/config-${LINPHONE_BUILDER_TOOLCHAIN}.cmake)
# Define the build options
include(CMakeDependentOption)
option(ENABLE_VIDEO "Enable video support." ${DEFAULT_VALUE_ENABLE_VIDEO})
option(ENABLE_GPL_THIRD_PARTIES "Enable GPL third-parties (ffmpeg and ZRTP)." ${DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES})
cmake_dependent_option(ENABLE_FFMPEG "Enable ffmpeg support." ${DEFAULT_VALUE_ENABLE_FFMPEG} "ENABLE_VIDEO;ENABLE_GPL_THIRD_PARTIES" OFF)
cmake_dependent_option(ENABLE_ZRTP "Enable ZRTP support." ${DEFAULT_VALUE_ENABLE_ZRTP} "ENABLE_GPL_THIRD_PARTIES" OFF)
option(ENABLE_SRTP "Enable SRTP support." ${DEFAULT_VALUE_ENABLE_SRTP})
option(ENABLE_AMR "Enable AMR audio codec support." ${DEFAULT_VALUE_ENABLE_AMR})
option(ENABLE_G729 "Enable G.729 audio codec support." ${DEFAULT_VALUE_ENABLE_G729})
option(ENABLE_GSM "Enable GSM audio codec support." ${DEFAULT_VALUE_ENABLE_GSM})
option(ENABLE_ILBC "Enable iLBC audio codec support." ${DEFAULT_VALUE_ENABLE_ILBC})
option(ENABLE_ISAC "Enable ISAC audio codec support." ${DEFAULT_VALUE_ENABLE_ISAC})
option(ENABLE_OPUS "Enable OPUS audio codec support." ${DEFAULT_VALUE_ENABLE_OPUS})
option(ENABLE_SILK "Enable SILK audio codec support." ${DEFAULT_VALUE_ENABLE_SILK})
option(ENABLE_SPEEX "Enable speex audio codec support." ${DEFAULT_VALUE_ENABLE_SPEEX})
cmake_dependent_option(ENABLE_VPX "Enable VPX video codec support." ${DEFAULT_VALUE_ENABLE_VPX} "ENABLE_VIDEO" OFF)
cmake_dependent_option(ENABLE_X264 "Enable H.264 audio encoder support with the x264 library." ${DEFAULT_VALUE_ENABLE_X264} "ENABLE_VIDEO" OFF)
option(ENABLE_TUNNEL "Enable tunnel support." ${DEFAULT_VALUE_ENABLE_TUNNEL})
# Include builders definitions
include(builders/CMakeLists.txt)
############################################################################
# LinphoneBuilderOptions.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 the build options
include(CMakeDependentOption)
option(ENABLE_VIDEO "Enable video support." ${DEFAULT_VALUE_ENABLE_VIDEO})
option(ENABLE_GPL_THIRD_PARTIES "Enable GPL third-parties (ffmpeg and ZRTP)." ${DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES})
cmake_dependent_option(ENABLE_FFMPEG "Enable ffmpeg support." ${DEFAULT_VALUE_ENABLE_FFMPEG} "ENABLE_VIDEO;ENABLE_GPL_THIRD_PARTIES" OFF)
cmake_dependent_option(ENABLE_ZRTP "Enable ZRTP support." ${DEFAULT_VALUE_ENABLE_ZRTP} "ENABLE_GPL_THIRD_PARTIES" OFF)
option(ENABLE_SRTP "Enable SRTP support." ${DEFAULT_VALUE_ENABLE_SRTP})
option(ENABLE_AMR "Enable AMR audio codec support." ${DEFAULT_VALUE_ENABLE_AMR})
option(ENABLE_G729 "Enable G.729 audio codec support." ${DEFAULT_VALUE_ENABLE_G729})
option(ENABLE_GSM "Enable GSM audio codec support." ${DEFAULT_VALUE_ENABLE_GSM})
option(ENABLE_ILBC "Enable iLBC audio codec support." ${DEFAULT_VALUE_ENABLE_ILBC})
option(ENABLE_ISAC "Enable ISAC audio codec support." ${DEFAULT_VALUE_ENABLE_ISAC})
option(ENABLE_OPUS "Enable OPUS audio codec support." ${DEFAULT_VALUE_ENABLE_OPUS})
option(ENABLE_SILK "Enable SILK audio codec support." ${DEFAULT_VALUE_ENABLE_SILK})
option(ENABLE_SPEEX "Enable speex audio codec support." ${DEFAULT_VALUE_ENABLE_SPEEX})
cmake_dependent_option(ENABLE_VPX "Enable VPX video codec support." ${DEFAULT_VALUE_ENABLE_VPX} "ENABLE_VIDEO" OFF)
cmake_dependent_option(ENABLE_X264 "Enable H.264 audio encoder support with the x264 library." ${DEFAULT_VALUE_ENABLE_X264} "ENABLE_VIDEO" OFF)
option(ENABLE_TUNNEL "Enable tunnel support." ${DEFAULT_VALUE_ENABLE_TUNNEL})
option(ENABLE_UNIT_TESTS "Enable unit tests support with CUnit library." ${DEFAULT_VALUE_ENABLE_UNIT_TESTS})
......@@ -20,6 +20,7 @@
#
############################################################################
# Define default values for the linphone builder options
set(DEFAULT_VALUE_ENABLE_VIDEO OFF)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG OFF)
......@@ -36,11 +37,16 @@ set(DEFAULT_VALUE_ENABLE_SPEEX ON)
set(DEFAULT_VALUE_ENABLE_VPX OFF)
set(DEFAULT_VALUE_ENABLE_X264 OFF)
set(DEFAULT_VALUE_ENABLE_TUNNEL OFF)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
# Include default configuration
include(configs/config-default.cmake)
set(AUTOTOOLS_SHARED_LIBRARIES "--disable-static --enable-shared")
set(CMAKE_SHARED_LIBRARIES "-DENABLE_STATIC=0")
# cunit
set(EP_cunit_CMAKE_OPTIONS "${CMAKE_SHARED_LIBRARIES} ${EP_cunit_CMAKE_OPTIONS}")
......@@ -67,10 +73,10 @@ set(EP_speex_CMAKE_OPTIONS "${CMAKE_SHARED_LIBRARIES} ${EP_speex_CMAKE_OPTIONS}"
set(EP_opus_CONFIGURE_OPTIONS "${AUTOTOOLS_SHARED_LIBRARIES} ${EP_opus_CONFIGURE_OPTIONS} --enable-fixed-point --disable-asm")
# oRTP
set(EP_ortp_CONFIGURE_OPTIONS "${AUTOTOOLS_SHARED_LIBRARIES} ${EP_ortp_CONFIGURE_OPTIONS} --disable-zrtp --enable-broken-srtp")
set(EP_ortp_CONFIGURE_OPTIONS "${AUTOTOOLS_SHARED_LIBRARIES} ${EP_ortp_CONFIGURE_OPTIONS}")
# mediastreamer2
set(EP_ms2_CONFIGURE_OPTIONS "${AUTOTOOLS_SHARED_LIBRARIES} ${EP_ms2_CONFIGURE_OPTIONS} --disable-nls --disable-theora --disable-sdl --disable-x11 --disable-video --disable-alsa --enable-qsa --enable-relativeprefix=yes")
# linphone
set(EP_linphone_CONFIGURE_OPTIONS "${AUTOTOOLS_SHARED_LIBRARIES} ${EP_linphone_CONFIGURE_OPTIONS} --disable-nls --with-readline=none --enable-gtk_ui=no --enable-console_ui=no --disable-x11 --disable-tutorials --disable-tools --disable-msg-storage --disable-video --disable-zrtp --disable-alsa --enable-relativeprefix=yes")
set(EP_linphone_CONFIGURE_OPTIONS "${AUTOTOOLS_SHARED_LIBRARIES} ${EP_linphone_CONFIGURE_OPTIONS} --disable-nls --with-readline=none --enable-gtk_ui=no --enable-console_ui=no --disable-x11 --disable-tutorials --disable-tools --disable-msg-storage --disable-video --disable-alsa --enable-relativeprefix=yes")
......@@ -20,35 +20,33 @@
#
############################################################################
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_AMR ON)
set(DEFAULT_VALUE_ENABLE_G729 ON)
set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_ILBC ON)
set(DEFAULT_VALUE_ENABLE_ISAC ON)
set(DEFAULT_VALUE_ENABLE_OPUS ON)
set(DEFAULT_VALUE_ENABLE_SILK ON)
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_X264 ON)
set(DEFAULT_VALUE_ENABLE_TUNNEL OFF)
# Include linphone builder options definitions
include(cmake/LinphoneBuilderOptions.cmake)
# List of the projects to build. The order is important and must follow the dependencies.
set(LINPHONE_BUILDER_BUILDERS
cunit
set(LINPHONE_BUILDER_BUILDERS )
if(${ENABLE_UNIT_TESTS})
list(APPEND LINPHONE_BUILDER_BUILDERS cunit)
endif(${ENABLE_UNIT_TESTS})
if(${ENABLE_SRTP})
list(APPEND LINPHONE_BUILDER_BUILDERS srtp)
endif(${ENABLE_SRTP})
if(${ENABLE_GSM})
list(APPEND LINPHONE_BUILDER_BUILDERS gsm)
endif(${ENABLE_GSM})
if(${ENABLE_OPUS})
list(APPEND LINPHONE_BUILDER_BUILDERS opus)
endif(${ENABLE_OPUS})
if(${ENABLE_SPEEX})
list(APPEND LINPHONE_BUILDER_BUILDERS speex)
endif(${ENABLE_SPEEX})
list(APPEND LINPHONE_BUILDER_BUILDERS
xml2
antlr3c
polarssl
bellesip
srtp
gsm
speex
opus
ortp
ms2
linphone
......@@ -77,7 +75,12 @@ set(EP_polarssl_GIT_TAG "linphone")
# belle-sip
set(EP_bellesip_GIT_REPOSITORY "git://git.linphone.org/belle-sip.git")
set(EP_bellesip_GIT_TAG "master")
set(EP_bellesip_DEPENDENCIES EP_antlr3c EP_cunit EP_polarssl)
set(EP_bellesip_DEPENDENCIES EP_antlr3c EP_polarssl)
if(${ENABLE_UNIT_TESTS})
list(APPEND EP_bellesip_DEPENDENCIES EP_cunit)
else(${ENABLE_UNIT_TESTS})
set(EP_bellesip_CMAKE_OPTIONS "${EP_bellesip_CMAKE_OPTIONS} -DENABLE_TESTS=0")
endif(${ENABLE_UNIT_TESTS})
# srtp
set(EP_srtp_GIT_REPOSITORY "git://git.linphone.org/srtp.git")
......@@ -101,16 +104,56 @@ set(EP_opus_CONFIGURE_OPTIONS "--disable-extra-programs --disable-doc")
set(EP_ortp_GIT_REPOSITORY "git://git.linphone.org/ortp.git")
set(EP_ortp_GIT_TAG "master")
set(EP_ortp_CONFIGURE_OPTIONS "--disable-strict")
set(EP_ortp_DEPENDENCIES EP_srtp)
set(EP_ortp_DEPENDENCIES )
if(${ENABLE_SRTP})
set(EP_ortp_CONFIGURE_OPTIONS "${EP_ortp_CONFIGURE_OPTIONS} --with-srtp=${CMAKE_INSTALL_PREFIX}")
list(APPEND EP_ortp_DEPENDENCIES EP_srtp)
endif(${ENABLE_SRTP})
if(${ENABLE_ZRTP})
# TODO
else(${ENABLE_ZRTP})
set(EP_ortp_CONFIGURE_OPTIONS "${EP_ortp_CONFIGURE_OPTIONS} --disable-zrtp")
endif(${ENABLE_ZRTP})
# mediastreamer2
set(EP_ms2_GIT_REPOSITORY "git://git.linphone.org/mediastreamer2.git")
set(EP_ms2_GIT_TAG "master")
set(EP_ms2_CONFIGURE_OPTIONS "--disable-strict --enable-external-ortp")
set(EP_ms2_DEPENDENCIES EP_ortp EP_gsm EP_speex EP_opus)
set(EP_ms2_DEPENDENCIES EP_ortp)
if(${ENABLE_GSM})
set(EP_ms2_CONFIGURE_OPTIONS "${EP_ms2_CONFIGURE_OPTIONS} --with-gsm=${CMAKE_INSTALL_PREFIX}")
list(APPEND EP_ms2_DEPENDENCIES EP_gsm)
else(${ENABLE_GSM})
set(EP_ms2_CONFIGURE_OPTIONS "${EP_ms2_CONFIGURE_OPTIONS} --disable-gsm")
endif(${ENABLE_GSM})
if(${ENABLE_OPUS})
list(APPEND EP_ms2_DEPENDENCIES EP_opus)
else(${ENABLE_OPUS})
set(EP_ms2_CONFIGURE_OPTIONS "${EP_ms2_CONFIGURE_OPTIONS} --disable-opus")
endif(${ENABLE_OPUS})
if(${ENABLE_SPEEX})
list(APPEND EP_ms2_DEPENDENCIES EP_speex)
else(${ENABLE_SPEEX})
set(EP_ms2_CONFIGURE_OPTIONS "${EP_ms2_CONFIGURE_OPTIONS} --disable-speex")
endif(${ENABLE_SPEEX})
if(${ENABLE_UNIT_TESTS})
list(APPEND EP_ms2_DEPENDENCIES EP_cunit)
else(${ENABLE_UNIT_TESTS})
set(EP_ms2_CONFIGURE_OPTIONS "${EP_ms2_CONFIGURE_OPTIONS} --disable-tests")
endif(${ENABLE_UNIT_TESTS})
# linphone
set(EP_linphone_GIT_REPOSITORY "git://git.linphone.org/linphone.git")
set(EP_linphone_GIT_TAG "master")
set(EP_linphone_CONFIGURE_OPTIONS "--disable-strict --enable-bellesip --enable-external-ortp --enable-external-mediastreamer")
set(EP_linphone_DEPENDENCIES EP_bellesip EP_ortp EP_ms2 EP_xml2)
if(${ENABLE_ZRTP})
# TODO
else(${ENABLE_ZRTP})
set(EP_linphone_CONFIGURE_OPTIONS "${EP_linphone_CONFIGURE_OPTIONS} --disable-zrtp")
endif(${ENABLE_ZRTP})
if(${ENABLE_UNIT_TESTS})
list(APPEND EP_linphone_DEPENDENCIES EP_cunit)
else(${ENABLE_UNIT_TESTS})
set(EP_linphone_CONFIGURE_OPTIONS "${EP_linphone_CONFIGURE_OPTIONS} --disable-tests")
endif(${ENABLE_UNIT_TESTS})
......@@ -20,9 +20,33 @@
#
############################################################################
# Define default values for the linphone builder options
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_AMR ON)
set(DEFAULT_VALUE_ENABLE_G729 ON)
set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_ILBC ON)
set(DEFAULT_VALUE_ENABLE_ISAC ON)
set(DEFAULT_VALUE_ENABLE_OPUS ON)
set(DEFAULT_VALUE_ENABLE_SILK ON)
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_X264 ON)
set(DEFAULT_VALUE_ENABLE_TUNNEL OFF)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
# Include default configuration
include(configs/config-default.cmake)
set(AUTOTOOLS_SHARED_LIBRARIES "--disable-static --enable-shared")
set(CMAKE_SHARED_LIBRARIES "-DENABLE_STATIC=0")
# cunit
set(EP_cunit_CMAKE_OPTIONS "${CMAKE_SHARED_LIBRARIES} ${EP_cunit_CMAKE_OPTIONS} -DENABLE_CURSES=1")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment