Return an array from get_read/write_vector
[alure.git] / cmake / FindOpus.cmake
blob1cc0e0a5d6b192aeb9945aabfebb823d410cc32f
1 # - FindOpus.cmake
2 # Find the native opus includes and libraries
4 # OPUS_INCLUDE_DIRS - where to find opus/opus.h, etc.
5 # OPUS_LIBRARIES - List of libraries when using libopus(file).
6 # OPUS_FOUND - True if libopus found.
8 if(OPUS_INCLUDE_DIR AND OPUS_LIBRARY AND OPUSFILE_LIBRARY)
9     # Already in cache, be silent
10     set(OPUS_FIND_QUIETLY TRUE)
11 endif(OPUS_INCLUDE_DIR AND OPUS_LIBRARY AND OPUSFILE_LIBRARY)
13 find_path(OPUS_INCLUDE_DIR
14     NAMES opusfile.h
15     PATH_SUFFIXES opus
18 # MSVC built opus may be named opus_static
19 # The provided project files name the library with the lib prefix.
20 find_library(OPUS_LIBRARY
21     NAMES opus opus_static libopus libopus_static
23 find_library(OPUSFILE_LIBRARY
24     NAMES opusfile opusfile_static libopusfile libopusfile_static
27 # Handle the QUIETLY and REQUIRED arguments and set OPUS_FOUND
28 # to TRUE if all listed variables are TRUE.
29 include(FindPackageHandleStandardArgs)
30 find_package_handle_standard_args(OPUS DEFAULT_MSG
31     OPUSFILE_LIBRARY OPUS_LIBRARY OPUS_INCLUDE_DIR
34 if(OPUS_FOUND)
35     set(OPUS_LIBRARIES ${OPUSFILE_LIBRARY} ${OPUS_LIBRARY})
36     set(OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR})
37 endif(OPUS_FOUND)