File: Findopusfile.cmake

package info (click to toggle)
audacity 3.7.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 125,252 kB
  • sloc: cpp: 358,238; ansic: 75,458; lisp: 7,761; sh: 3,410; python: 1,503; xml: 1,385; perl: 854; makefile: 122
file content (36 lines) | stat: -rw-r--r-- 902 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
#[[
A module to look for Opus
]]

if( NOT opusfile_FOUND )
   include( FindPackageHandleStandardArgs)

   find_path( opusfile_INCLUDE_DIR opus/opusfile.h
      HINTS
         ${OPUSFILE_ROOT}
   )

   find_library( opusfile_LIBRARIES
      NAMES
         opusfile
      HINTS
         ${OPUSFILE_ROOT}
   )

   find_package_handle_standard_args( opusfile DEFAULT_MSG opusfile_INCLUDE_DIR opusfile_LIBRARIES )

   if( opusfile_FOUND )
      if( NOT TARGET opusfile::opusfile )
         add_library( opusfile::opusfile INTERFACE IMPORTED GLOBAL )

         target_include_directories( opusfile::opusfile INTERFACE ${opusfile_INCLUDE_DIR} "${opusfile_INCLUDE_DIR}/opus" )
         target_link_libraries( opusfile::opusfile INTERFACE ${opusfile_LIBRARIES} )
      endif()

      mark_as_advanced(
         opusfile_FOUND
         opusfile_INCLUDE_DIR
         opusfile_LIBRARIES
      )
   endif()
endif()