Added CMake detection support for libsoxr

This commit is contained in:
Armin Novak 2018-11-13 09:13:52 +01:00
parent ab15e34032
commit e93aab2f7f
3 changed files with 67 additions and 0 deletions

View File

@ -770,6 +770,10 @@ set(FAAC_FEATURE_TYPE "OPTIONAL")
set(FAAC_FEATURE_PURPOSE "codec") set(FAAC_FEATURE_PURPOSE "codec")
set(FAAC_FEATURE_DESCRIPTION "FAAC AAC audio codec library") set(FAAC_FEATURE_DESCRIPTION "FAAC AAC audio codec library")
set(SOXR_FEATURE_TYPE "OPTIONAL")
set(SOXR_FEATURE_PURPOSE "codec")
set(SOXR_FEATURE_DESCRIPTION "SOX audio resample library")
set(GSSAPI_FEATURE_TYPE "OPTIONAL") set(GSSAPI_FEATURE_TYPE "OPTIONAL")
set(GSSAPI_FEATURE_PURPOSE "auth") set(GSSAPI_FEATURE_PURPOSE "auth")
set(GSSAPI_FEATURE_DESCRIPTION "add kerberos support") set(GSSAPI_FEATURE_DESCRIPTION "add kerberos support")
@ -873,6 +877,7 @@ find_feature(GSM ${GSM_FEATURE_TYPE} ${GSM_FEATURE_PURPOSE} ${GSM_FEATURE_DESCRI
find_feature(LAME ${LAME_FEATURE_TYPE} ${LAME_FEATURE_PURPOSE} ${LAME_FEATURE_DESCRIPTION}) find_feature(LAME ${LAME_FEATURE_TYPE} ${LAME_FEATURE_PURPOSE} ${LAME_FEATURE_DESCRIPTION})
find_feature(FAAD2 ${FAAD2_FEATURE_TYPE} ${FAAD2_FEATURE_PURPOSE} ${FAAD2_FEATURE_DESCRIPTION}) find_feature(FAAD2 ${FAAD2_FEATURE_TYPE} ${FAAD2_FEATURE_PURPOSE} ${FAAD2_FEATURE_DESCRIPTION})
find_feature(FAAC ${FAAC_FEATURE_TYPE} ${FAAC_FEATURE_PURPOSE} ${FAAC_FEATURE_DESCRIPTION}) find_feature(FAAC ${FAAC_FEATURE_TYPE} ${FAAC_FEATURE_PURPOSE} ${FAAC_FEATURE_DESCRIPTION})
find_feature(soxr ${SOXR_FEATURE_TYPE} ${SOXR_FEATURE_PURPOSE} ${SOXR_FEATURE_DESCRIPTION})
find_feature(GSSAPI ${GSSAPI_FEATURE_TYPE} ${GSSAPI_FEATURE_PURPOSE} ${GSSAPI_FEATURE_DESCRIPTION}) find_feature(GSSAPI ${GSSAPI_FEATURE_TYPE} ${GSSAPI_FEATURE_PURPOSE} ${GSSAPI_FEATURE_DESCRIPTION})

61
cmake/Findsoxr.cmake Normal file
View File

@ -0,0 +1,61 @@
# Try to find the soxr library
#
# Copyright 2018 Thincast Technologies GmbH
# Copyright 2018 Armin Novak <armin.novak@thincast.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
#
# Once done this will define
#
# SOXR_ROOT - A list of search hints
#
# SOXR_FOUND - system has soxr
# SOXR_INCLUDE_DIR - the soxr include directory
# SOXR_LIBRARIES - libsoxr library
if (UNIX AND NOT ANDROID)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_SOXR QUIET soxr)
endif (UNIX AND NOT ANDROID)
if (SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
set(SOXR_FIND_QUIETLY TRUE)
endif (SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
find_path(SOXR_INCLUDE_DIR NAMES soxr.h
PATH_SUFFIXES include
HINTS ${SOXR_ROOT} ${PC_SOXR_INCLUDE_DIRS})
find_library(SOXR_LIBRARY
NAMES soxr
PATH_SUFFIXES lib
HINTS ${SOXR_ROOT} ${PC_SOXR_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(soxr DEFAULT_MSG SOXR_LIBRARY SOXR_INCLUDE_DIR)
if (SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
set(SOXR_FOUND TRUE)
set(SOXR_LIBRARIES ${SOXR_LIBRARY})
endif (SOXR_INCLUDE_DIR AND SOXR_LIBRARY)
if (SOXR_FOUND)
if (NOT SOXR_FIND_QUIETLY)
message(STATUS "Found soxr: ${SOXR_LIBRARIES}")
endif (NOT SOXR_FIND_QUIETLY)
else (SOXR_FOUND)
if (SOXR_FIND_REQUIRED)
message(FATAL_ERROR "soxr was not found")
endif(SOXR_FIND_REQUIRED)
endif (SOXR_FOUND)
mark_as_advanced(SOXR_INCLUDE_DIR SOXR_LIBRARY)

View File

@ -57,6 +57,7 @@
#cmakedefine WITH_LAME #cmakedefine WITH_LAME
#cmakedefine WITH_FAAD2 #cmakedefine WITH_FAAD2
#cmakedefine WITH_FAAC #cmakedefine WITH_FAAC
#cmakedefine WITH_SOXR
#cmakedefine WITH_GFX_H264 #cmakedefine WITH_GFX_H264
#cmakedefine WITH_OPENH264 #cmakedefine WITH_OPENH264
#cmakedefine WITH_FFMPEG #cmakedefine WITH_FFMPEG