if(NOT(HAVE_SOUNDCARD_H OR HAVE_SYS_SOUNDCARD_H OR HAVE_MACHINE_SOUNDCARD_H OR HAVE_SYS_AUDIO_H))
set(ENABLE_OSS OFF CACHE BOOL "Enable OSS support." FORCE)
endif()
endif()
check_library_exists("dl""dlopen""" HAVE_DLOPEN)
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
find_package(ORTP REQUIRED)
if(ENABLE_GSM)
find_package(GSM)
if(NOT GSM_FOUND)
message(WARNING "Could not find GSM library, mediastreamer2 will be compiled without the GSM codec.")
set(ENABLE_GSM OFF CACHE BOOL "Build mediastreamer2 with the GSM codec." FORCE)
endif()
endif()
if(ENABLE_OPUS)
find_package(Opus)
if(NOT OPUS_FOUND)
message(WARNING "Could not find opus library, mediastreamer2 will be compiled without the OPUS codec.")
set(ENABLE_OPUS OFF CACHE BOOL "Build mediastreamer2 with the OPUS codec." FORCE)
endif()
endif()
if(ENABLE_SPEEX)
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)
endif()
endif()
if(ENABLE_ALSA)
find_package(ALSA)
if(NOT ALSA_FOUND)
set(ENABLE_ALSA OFF CACHE BOOL "Enable ALSA support." FORCE)
endif()
endif()
if(ENABLE_ARTSC)
find_package(Arts REQUIRED)
endif()
if(ENABLE_PORTAUDIO)
find_package(PortAudio REQUIRED)
endif()
if(ENABLE_PULSEAUDIO)
find_package(PulseAudio)
if(NOT PULSEAUDIO_FOUND)
set(ENABLE_PULSEAUDIO OFF CACHE BOOL "Enable pulseaudio support." FORCE)
endif()
endif()
if(ENABLE_QSA)
find_package(QSA REQUIRED)
endif()
if(ENABLE_VIDEO)
add_definitions(-DVIDEO_ENABLED)
endif()
if(ENABLE_FFMPEG)
find_package(FFMpeg REQUIRED)
else()
add_definitions(-DNO_FFMPEG)
endif()
if(ENABLE_X11)
find_package(X11)
if(NOT X11_FOUND)
set(ENABLE_X11 OFF CACHE BOOL "Enable X11 support." FORCE)
endif()
endif()
if(ENABLE_XV)
find_package(Xv)
if(XV_FOUND)
set(HAVE_XV 1)
else()
set(ENABLE_XV OFF CACHE BOOL "Enable XV support." FORCE)
endif()
endif()
if(ENABLE_GLX)
find_package(GLX)
if(GLX_FOUND)
set(HAVE_GL 1)
else()
set(ENABLE_GLX OFF CACHE BOOL "Enable X11+OpenGL rendering support (requires glx and glew)." FORCE)
endif()
endif()
# TODO: Handle SDL option
# TODO: Handle Theora option
if(ENABLE_VPX)
find_package(VPX)
if(NOT VPX_FOUND)
set(ENABLE_VPX OFF CACHE BOOL "Build mediastreamer2 with VPX codec." FORCE)
endif()
endif()
if(ENABLE_SOUND AND NOT(WIN32 OR ENABLE_ALSA OR ENABLE_ARTSC OR ENABLE_MACSND OR ENABLE_MACAQSND OR ENABLE_OSS OR ENABLE_PORTAUDIO OR ENABLE_PULSEAUDIO OR ENABLE_QSA))
message(FATAL_ERROR "Could not find a support sound driver API. Use -DENABLE_SOUND=NO if you don't care about having sound.")
endif()
option(MS2_ENABLE_FFMPEG "Build mediastreamer2 with ffmpeg video support (needs MS2_ENABLE_VIDEO)." ON)
option(MS2_ENABLE_GSM "Build mediastreamer2 with the GSM codec." OFF)
option(MS2_ENABLE_OPUS "Build mediastreamer2 with the OPUS codec." ON)
option(MS2_ENABLE_RESAMPLE "Build mediastreamer2 with the resampling capability." ON)
option(MS2_ENABLE_SPEEX "Build mediastreamer2 with the SPEEX codec." ON)
option(MS2_ENABLE_VIDEO "Build mediastreamer2 with video support." ON)
option(MS2_ENABLE_VPX "Build mediastreamer2 with VPX codec (needs MS2_ENABLE_VIDEO)." ON)