File: Findlibopus.cmake

package info (click to toggle)
utox 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 10,792 kB
  • sloc: ansic: 102,804; objc: 2,385; cpp: 2,069; java: 1,094; python: 868; javascript: 703; xml: 424; sh: 208; makefile: 53; sed: 9
file content (43 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# - Try to find opus
# Once done this will define
#  LIBOPUS_FOUND - System has opus
#  LIBOPUS_INCLUDE_DIRS - The opus include directories
#  LIBOPUS_LIBRARIES - The libraries needed to use opus
#  LIBOPUS_DEFINITIONS - Compiler switches required for using opus

find_package(PkgConfig)

pkg_check_modules(PKG_LIBOPUS QUIET libopus)
set(LIBOPUS_DEFINITIONS ${PKG_LIBOPUS_CFLAGS_OTHER})

find_path(LIBOPUS_INCLUDE_DIR opus/opus.h HINTS
    ${PKG_LIBOPUS_INCLUDEDIR}
    ${PKG_LIBOPUS_INCLUDE_DIRS}
)

if(STATIC_ALL OR STATIC_OPUS)
    find_library(LIBOPUS_LIBRARY NAMES libopus.a HINTS
        ${PKG_LIBOPUS_LIBDIR}
        ${PKG_LIBOPUS_LIBRARY_DIRS}
    )
else()
    find_library(LIBOPUS_LIBRARY NAMES opus HINTS
        ${PKG_LIBOPUS_LIBDIR}
        ${PKG_LIBOPUS_LIBRARY_DIRS}
    )
endif()

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBOPUS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
    libopus
    DEFAULT_MSG
    LIBOPUS_LIBRARY
    LIBOPUS_INCLUDE_DIR
)

mark_as_advanced(LIBOPUS_INCLUDE_DIR LIBOPUS_LIBRARY)

set(LIBOPUS_LIBRARIES ${LIBOPUS_LIBRARY})
set(LIBOPUS_INCLUDE_DIRS ${LIBOPUS_INCLUDE_DIR})