2016-07-25 19:46:54 -07:00
|
|
|
# Once done these will be defined:
|
|
|
|
#
|
2022-03-16 15:11:06 -07:00
|
|
|
# LIBSPEEXDSP_FOUND LIBSPEEXDSP_INCLUDE_DIRS LIBSPEEXDSP_LIBRARIES
|
2016-07-25 19:46:54 -07:00
|
|
|
#
|
|
|
|
# For use in OBS:
|
|
|
|
#
|
2022-03-16 15:11:06 -07:00
|
|
|
# SPEEXDSP_INCLUDE_DIR
|
2016-07-25 19:46:54 -07:00
|
|
|
|
|
|
|
find_package(PkgConfig QUIET)
|
2022-03-16 15:11:06 -07:00
|
|
|
if(PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(_SPEEXDSP QUIET speexdsp libspeexdsp)
|
2016-07-25 19:46:54 -07:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
2022-03-16 15:11:06 -07:00
|
|
|
set(_lib_suffix 64)
|
2016-07-25 19:46:54 -07:00
|
|
|
else()
|
2022-03-16 15:11:06 -07:00
|
|
|
set(_lib_suffix 32)
|
2016-07-25 19:46:54 -07:00
|
|
|
endif()
|
|
|
|
|
2022-03-16 15:11:06 -07:00
|
|
|
find_path(
|
|
|
|
SPEEXDSP_INCLUDE_DIR
|
|
|
|
NAMES speex/speex_preprocess.h
|
|
|
|
HINTS ENV SPEEX_PATH ${SPEEX_PATH} ${CMAKE_SOURCE_DIR}/${SPEEX_PATH}
|
|
|
|
${_SPEEXDSP_INCLUDE_DIRS}
|
|
|
|
PATHS /usr/include /usr/local/include /opt/local/include /sw/include
|
|
|
|
PATH_SUFFIXES include)
|
2016-07-25 19:46:54 -07:00
|
|
|
|
2022-03-16 15:11:06 -07:00
|
|
|
find_library(
|
|
|
|
SPEEXDSP_LIB
|
|
|
|
NAMES ${_SPEEXDSP_LIBRARIES} speexdsp libspeexdsp
|
|
|
|
HINTS ENV SPEEX_PATH ${SPEEX_PATH} ${CMAKE_SOURCE_DIR}/${SPEEX_PATH}
|
|
|
|
${_SPEEXDSP_LIBRARY_DIRS}
|
|
|
|
PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib${_lib_suffix}
|
|
|
|
lib
|
|
|
|
libs${_lib_suffix}
|
|
|
|
libs
|
|
|
|
bin${_lib_suffix}
|
|
|
|
bin
|
|
|
|
../lib${_lib_suffix}
|
|
|
|
../lib
|
|
|
|
../libs${_lib_suffix}
|
|
|
|
../libs
|
|
|
|
../bin${_lib_suffix}
|
|
|
|
../bin)
|
2016-07-25 19:46:54 -07:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2022-03-16 15:11:06 -07:00
|
|
|
find_package_handle_standard_args(Libspeexdsp DEFAULT_MSG SPEEXDSP_LIB
|
|
|
|
SPEEXDSP_INCLUDE_DIR)
|
2016-07-25 19:46:54 -07:00
|
|
|
mark_as_advanced(SPEEXDSP_INCLUDE_DIR SPEEXDSP_LIB)
|
|
|
|
|
|
|
|
if(LIBSPEEXDSP_FOUND)
|
2022-03-16 15:11:06 -07:00
|
|
|
set(LIBSPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR})
|
|
|
|
set(LIBSPEEXDSP_LIBRARIES ${SPEEXDSP_LIB})
|
|
|
|
|
|
|
|
if(NOT TARGET LibspeexDSP::LibspeexDSP)
|
|
|
|
if(IS_ABSOLUTE "${LIBSPEEXDSP_LIBRARIES}")
|
|
|
|
add_library(LibspeexDSP::LibspeexDSP UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(
|
|
|
|
LibspeexDSP::LibspeexDSP PROPERTIES IMPORTED_LOCATION
|
|
|
|
"${LIBSPEEXDSP_LIBRARIES}")
|
|
|
|
else()
|
|
|
|
add_library(LibspeexDSP::LibspeexDSP INTERFACE IMPORTED)
|
|
|
|
set_target_properties(
|
|
|
|
LibspeexDSP::LibspeexDSP PROPERTIES IMPORTED_LIBNAME
|
|
|
|
"${LIBSPEEXDSP_LIBRARIES}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(
|
|
|
|
LibspeexDSP::LibspeexDSP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
|
|
|
|
"${LIBSPEEXDSP_INCLUDE_DIRS}")
|
|
|
|
endif()
|
2016-07-25 19:46:54 -07:00
|
|
|
endif()
|