1 # Find the system's opus includes and library
3 # OPUS_INCLUDE_DIRS - where to find opus.h
4 # OPUS_LIBRARIES - List of libraries when using opus
5 # OPUS_FOUND - True if opus found
6 # OPUS_DLL_DIR - (Windows) Path to the opus DLL
7 # OPUS_DLL - (Windows) Name of the opus DLL
9 include( FindWSWinLibs )
10 FindWSWinLibs( "opus-.*" "OPUS_HINTS" )
12 if (NOT USE_REPOSITORY)
13 find_package(PkgConfig)
14 pkg_search_module(OPUS opus)
17 find_path(OPUS_INCLUDE_DIR
20 "${OPUS_INCLUDE_DIRS}"
21 "${OPUS_HINTS}/include"
22 PATHS /usr/local/include /usr/include
25 find_library(OPUS_LIBRARY
28 "${OPUS_LIBRARY_DIRS}"
30 PATHS /usr/local/lib /usr/lib
33 include(FindPackageHandleStandardArgs)
34 find_package_handle_standard_args(OPUS DEFAULT_MSG OPUS_LIBRARY OPUS_INCLUDE_DIR)
37 set( OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR} )
38 set( OPUS_LIBRARIES ${OPUS_LIBRARY} )
40 set ( OPUS_DLL_DIR "${OPUS_HINTS}/bin"
41 CACHE PATH "Path to opus DLL"
43 file( GLOB _opus_dll RELATIVE "${OPUS_DLL_DIR}"
44 "${OPUS_DLL_DIR}/opus.dll"
46 set ( OPUS_DLL ${_opus_dll}
47 # We're storing filenames only. Should we use STRING instead?
48 CACHE FILEPATH "opus DLL file name"
50 mark_as_advanced( OPUS_DLL_DIR OPUS_DLL )
53 set( OPUS_INCLUDE_DIRS )
57 mark_as_advanced( OPUS_LIBRARIES OPUS_INCLUDE_DIRS )