| 1 |
find_package(PkgConfig QUIET) |
| 2 |
if(PKG_CONFIG_FOUND) |
| 3 |
pkg_search_module(PC_SpeexDSP QUIET speexdsp libspeexdsp) |
| 4 |
endif() |
| 5 |
|
| 6 |
find_path(SpeexDSP_INCLUDE_DIR |
| 7 |
NAMES |
| 8 |
"speex/speexdsp_types.h" |
| 9 |
HINTS |
| 10 |
${PC_SpeexDSP_INCLUDEDIR} |
| 11 |
${PC_SpeexDSP_INCLUDE_DIRS} |
| 12 |
) |
| 13 |
mark_as_advanced(SpeexDSP_INCLUDE_DIR) |
| 14 |
|
| 15 |
find_library(SpeexDSP_LIBRARY |
| 16 |
NAMES |
| 17 |
speexdsp |
| 18 |
libspeexdsp |
| 19 |
HINTS |
| 20 |
${PC_SpeexDSP_LIBDIR} |
| 21 |
${PC_SpeexDSP_LIBRARY_DIRS} |
| 22 |
) |
| 23 |
mark_as_advanced(SpeexDSP_LIBRARY) |
| 24 |
|
| 25 |
include(FindPackageHandleStandardArgs) |
| 26 |
find_package_handle_standard_args(SpeexDSP |
| 27 |
REQUIRED_VARS |
| 28 |
SpeexDSP_INCLUDE_DIR |
| 29 |
SpeexDSP_LIBRARY |
| 30 |
VERSION_VAR |
| 31 |
SpeexDSP_VERSION |
| 32 |
) |
| 33 |
|
| 34 |
if(SpeexDSP_FOUND) |
| 35 |
set(SpeexDSP_INCLUDE_DIRS ${SpeexDSP_INCLUDE_DIR}) |
| 36 |
set(SpeexDSP_LIBRARIES ${SpeexDSP_LIBRARY}) |
| 37 |
set(SpeexDSP_DEFINITIONS ${PC_SpeexDSP_CFLAGS_OTHER}) |
| 38 |
|
| 39 |
if(NOT TARGET SpeexDSP::SpeexDSP) |
| 40 |
add_library(SpeexDSP::SpeexDSP UNKNOWN IMPORTED) |
| 41 |
set_target_properties(SpeexDSP::SpeexDSP PROPERTIES |
| 42 |
IMPORTED_LOCATION "${SpeexDSP_LIBRARIES}" |
| 43 |
INTERFACE_INCLUDE_DIRECTORIES "${SpeexDSP_INCLUDE_DIRS}" |
| 44 |
INTERFACE_COMPILE_OPTIONS "${SpeexDSP_DEFINITIONS}" |
| 45 |
) |
| 46 |
endif() |
| 47 |
endif() |