add opus options to cmakefiles

This commit is contained in:
badaix 2019-11-02 16:19:59 +01:00
parent 258bab4f65
commit 2a47e0b672
3 changed files with 20 additions and 0 deletions

View file

@ -14,6 +14,7 @@ option(BUILD_CLIENT "Build Snapclient" ON)
option(BUILD_WITH_FLAC "Build with FLAC support" ON)
option(BUILD_WITH_VORBIS "Build with VORBIS support" ON)
option(BUILD_WITH_TREMOR "Build with vorbis using TREMOR" ON)
option(BUILD_WITH_OPUS "Build with OPUS support" ON)
option(BUILD_WITH_AVAHI "Build with AVAHI support" ON)
@ -173,6 +174,13 @@ if(BUILD_WITH_VORBIS)
endif(VORBISENC_FOUND)
endif()
if(BUILD_WITH_OPUS)
pkg_search_module(OPUS opus)
if (OPUS_FOUND)
add_definitions("-DHAS_OPUS")
endif (OPUS_FOUND)
endif()
find_package(Boost 1.70 REQUIRED)
add_definitions("-DBOOST_ERROR_CODE_HEADER_ONLY")

View file

@ -68,6 +68,12 @@ if (FLAC_FOUND)
list(APPEND CLIENT_INCLUDE ${FLAC_INCLUDE_DIRS})
endif (FLAC_FOUND)
if (OPUS_FOUND)
list(APPEND CLIENT_SOURCES decoder/opus_decoder.cpp)
list(APPEND CLIENT_LIBRARIES ${OPUS_LIBRARIES})
list(APPEND CLIENT_INCLUDE ${OPUS_INCLUDE_DIRS})
endif (OPUS_FOUND)
include_directories(${CLIENT_INCLUDE})
add_executable(snapclient ${CLIENT_SOURCES})
target_link_libraries(snapclient ${CLIENT_LIBRARIES})

View file

@ -59,6 +59,12 @@ if (FLAC_FOUND)
list(APPEND SERVER_INCLUDE ${FLAC_INCLUDE_DIRS})
endif (FLAC_FOUND)
if (OPUS_FOUND)
list(APPEND SERVER_SOURCES encoder/opus_encoder.cpp)
list(APPEND SERVER_LIBRARIES ${OPUS_LIBRARIES})
list(APPEND SERVER_INCLUDE ${OPUS_INCLUDE_DIRS})
endif (OPUS_FOUND)
#list(APPEND SERVER_LIBRARIES Boost::boost)
include_directories(${SERVER_INCLUDE})