File: FindOPUS.cmake

package info (click to toggle)
wireshark 4.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 351,436 kB
  • sloc: ansic: 3,103,613; cpp: 129,736; xml: 100,978; python: 56,510; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 164; ruby: 113; objc: 91; tcl: 35
file content (57 lines) | stat: -rw-r--r-- 1,481 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Find the system's opus includes and library
#
#  OPUS_INCLUDE_DIRS - where to find opus.h
#  OPUS_LIBRARIES    - List of libraries when using opus
#  OPUS_FOUND        - True if opus found
#  OPUS_DLL_DIR      - (Windows) Path to the opus DLL
#  OPUS_DLL          - (Windows) Name of the opus DLL

include( FindWSWinLibs )
FindWSWinLibs( "opus-.*" "OPUS_HINTS" )

if (NOT USE_REPOSITORY)
  find_package(PkgConfig)
  pkg_search_module(OPUS opus)
endif()

find_path(OPUS_INCLUDE_DIR
  NAMES opus/opus.h
  HINTS
    "${OPUS_INCLUDE_DIRS}"
    "${OPUS_HINTS}/include"
  PATHS /usr/local/include /usr/include
)

find_library(OPUS_LIBRARY
  NAMES opus
  HINTS
    "${OPUS_LIBRARY_DIRS}"
    "${OPUS_HINTS}/lib"
  PATHS /usr/local/lib /usr/lib
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPUS DEFAULT_MSG OPUS_LIBRARY OPUS_INCLUDE_DIR)

if( OPUS_FOUND )
  set( OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR} )
  set( OPUS_LIBRARIES ${OPUS_LIBRARY} )
  if (WIN32)
    set ( OPUS_DLL_DIR "${OPUS_HINTS}/bin"
      CACHE PATH "Path to opus DLL"
    )
    file( GLOB _opus_dll RELATIVE "${OPUS_DLL_DIR}"
      "${OPUS_DLL_DIR}/opus.dll"
    )
    set ( OPUS_DLL ${_opus_dll}
      # We're storing filenames only. Should we use STRING instead?
      CACHE FILEPATH "opus DLL file name"
    )
    mark_as_advanced( OPUS_DLL_DIR OPUS_DLL )
  endif()
else()
  set( OPUS_INCLUDE_DIRS )
  set( OPUS_LIBRARIES )
endif()

mark_as_advanced( OPUS_LIBRARIES OPUS_INCLUDE_DIRS )