| 1 |
# OPUS_FOUND - system has opus |
| 2 |
# OPUS_INCLUDE_DIRS - the opus include directory |
| 3 |
# OPUS_LIBRARIES - The libraries needed to use opus |
| 4 |
|
| 5 |
find_path(OPUS_INCLUDE_DIRS |
| 6 |
NAMES opus/opus.h |
| 7 |
PATH_SUFFIXES include |
| 8 |
) |
| 9 |
if(OPUS_INCLUDE_DIRS) |
| 10 |
set(HAVE_OPUS_OPUS_H 1) |
| 11 |
endif() |
| 12 |
|
| 13 |
if(OPUS_USE_STATIC_LIBS) |
| 14 |
find_library(OPUS_LIBRARIES NAMES "libopus.a") |
| 15 |
else() |
| 16 |
find_library(OPUS_LIBRARIES NAMES opus) |
| 17 |
endif() |
| 18 |
|
| 19 |
if(OPUS_LIBRARIES) |
| 20 |
if(OPUS_USE_STATIC_LIBS) |
| 21 |
# on linux with glibc you CANT statically link libm without statically linking all of glibc. DONT DO IT. |
| 22 |
#find_library(LIBM NAMES "libm.a" "libm.tbd") |
| 23 |
else() |
| 24 |
find_library(LIBM NAMES m) |
| 25 |
endif() |
| 26 |
if(LIBM) |
| 27 |
list(APPEND OPUS_LIBRARIES ${LIBM}) |
| 28 |
endif() |
| 29 |
endif() |
| 30 |
|
| 31 |
include(FindPackageHandleStandardArgs) |
| 32 |
find_package_handle_standard_args(Opus |
| 33 |
DEFAULT_MSG |
| 34 |
OPUS_INCLUDE_DIRS OPUS_LIBRARIES HAVE_OPUS_OPUS_H |
| 35 |
) |
| 36 |
|
| 37 |
mark_as_advanced(OPUS_INCLUDE_DIRS OPUS_LIBRARIES HAVE_OPUS_OPUS_H) |