Commit f5d23bd9 authored by Ghislain MARY's avatar Ghislain MARY

Seperate search for libspeex and libspeexdsp.

parent 58b91814
......@@ -85,8 +85,9 @@ cmake_dependent_option(ENABLE_PULSEAUDIO "Enable pulseaudio support." YES "ENABL
option(ENABLE_GSM "Build mediastreamer2 with the GSM codec." YES)
option(ENABLE_BV16 "Build mediastreamer2 with the BV16 codec." YES)
option(ENABLE_OPUS "Build mediastreamer2 with the OPUS codec." YES)
cmake_dependent_option(ENABLE_RESAMPLE "Build mediastreamer2 with the resampling capability." YES "ENABLE_SPEEX" NO)
option(ENABLE_SPEEX "Build mediastreamer2 with the SPEEX codec." YES)
cmake_dependent_option(ENABLE_RESAMPLE "Build mediastreamer2 with the resampling capability." YES "ENABLE_SPEEX_DSP" NO)
option(ENABLE_SPEEX_CODEC "Build mediastreamer2 with the SPEEX codec." YES)
option(ENABLE_SPEEX_DSP "Build mediastreamer2 with the SPEEX DSP support." YES)
option(ENABLE_VIDEO "Build mediastreamer2 with video support." YES)
cmake_dependent_option(ENABLE_FFMPEG "Build mediastreamer2 with ffmpeg video support." YES "ENABLE_VIDEO" NO)
......@@ -202,13 +203,16 @@ if(ENABLE_OPUS)
set(ENABLE_OPUS OFF CACHE BOOL "Build mediastreamer2 with the OPUS codec." FORCE)
endif()
endif()
if(ENABLE_SPEEX)
if(ENABLE_SPEEX_CODEC)
find_package(Speex)
if(NOT SPEEX_FOUND)
message(WARNING "Could not find speex library, mediastreamer2 will be compiled without the SPEEX codec.")
set(ENABLE_SPEEX OFF CACHE BOOL "Build mediastreamer2 with the SPEEX codec." FORCE)
set(ENABLE_SPEEX_CODEC OFF CACHE BOOL "Build mediastreamer2 with the SPEEX codec." FORCE)
endif()
endif()
if(ENABLE_SPEEX_DSP)
find_package(SpeexDsp REQUIRED)
endif()
if(ENABLE_ALSA)
find_package(ALSA)
if(NOT ALSA_FOUND)
......@@ -333,6 +337,9 @@ endif()
if(SPEEX_FOUND)
include_directories(${SPEEX_INCLUDE_DIRS})
endif()
if(SPEEXDSP_FOUND)
include_directories(${SPEEXDSP_INCLUDE_DIRS})
endif()
if(FFMPEG_FOUND)
include_directories(${FFMPEG_INCLUDE_DIRS})
endif()
......@@ -435,7 +442,7 @@ endif()
if(ENABLE_QNX)
set(__QNX__ 1)
endif()
if(SPEEX_FOUND)
if(SPEEXDSP_FOUND)
set(HAVE_SPEEXDSP 1)
endif()
if(MATROSKA2_FOUND)
......
......@@ -26,13 +26,8 @@
# SPEEX_INCLUDE_DIRS - the speex include directory
# SPEEX_LIBRARIES - The libraries needed to use speex
set(_SPEEX_ROOT_PATHS
${CMAKE_INSTALL_PREFIX}
)
find_path(SPEEX_INCLUDE_DIRS
NAMES speex/speex.h
HINTS _SPEEX_ROOT_PATHS
PATH_SUFFIXES include
)
if(SPEEX_INCLUDE_DIRS)
......@@ -41,20 +36,12 @@ endif()
find_library(SPEEX_LIBRARIES
NAMES speex
HINTS _SPEEX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
find_library(SPEEXDSP_LIBRARIES
NAMES speexdsp
HINTS _SPEEX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
list(APPEND SPEEX_LIBRARIES ${SPEEXDSP_LIBRARIES})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Speex
DEFAULT_MSG
SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES SPEEXDSP_LIBRARIES HAVE_SPEEX_SPEEX_H
SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES HAVE_SPEEX_SPEEX_H
)
mark_as_advanced(SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES HAVE_SPEEX_SPEEX_H)
############################################################################
# FindSpeexDsp.txt
# 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.
#
############################################################################
#
# - Find the speexdsp include file and library
#
# SPEEXDSP_FOUND - system has speexdsp
# SPEEXDSP_INCLUDE_DIRS - the speexdsp include directory
# SPEEXDSP_LIBRARIES - The libraries needed to use speexdsp
find_path(SPEEXDSP_INCLUDE_DIRS
NAMES speex/speex_resampler.h
PATH_SUFFIXES include
)
if(SPEEXDSP_INCLUDE_DIRS)
set(HAVE_SPEEX_SPEEX_RESAMPLER_H 1)
endif()
find_library(SPEEXDSP_LIBRARIES
NAMES speexdsp
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SpeexDsp
DEFAULT_MSG
SPEEXDSP_INCLUDE_DIRS SPEEXDSP_LIBRARIES HAVE_SPEEX_SPEEX_RESAMPLER_H
)
mark_as_advanced(SPEEXDSP_INCLUDE_DIRS SPEEXDSP_LIBRARIES HAVE_SPEEX_SPEEX_RESAMPLER_H)
......@@ -244,10 +244,10 @@ if(ENABLE_RESAMPLE)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/msresample.c)
endif()
if(SPEEX_FOUND)
list(APPEND VOIP_SOURCE_FILES_C
audiofilters/msspeex.c
audiofilters/speexec.c
)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/msspeex.c)
endif()
if(SPEEXDSP_FOUND)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/speexec.c)
endif()
if(ENABLE_VIDEO)
......@@ -489,6 +489,9 @@ endif()
if(SPEEX_FOUND)
list(APPEND VOIP_LIBS ${SPEEX_LIBRARIES})
endif()
if(SPEEXDSP_FOUND)
list(APPEND VOIP_LIBS ${SPEEXDSP_LIBRARIES})
endif()
if(BV16_FOUND)
list(APPEND VOIP_LIBS ${BV16_LIBRARIES})
endif()
......
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