Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graph/cmake/Findopus.cmake

44 lines
1.3 KiB
CMake
Raw Normal View History

2019-01-08 22:27:42 -05:00
# - FindOpus.cmake
# Find the native opus includes and libraries
#
# OPUS_INCLUDE_DIRS - where to find opus/opus.h, etc.
# OPUS_LIBRARIES - List of libraries when using libopus(file).
# OPUS_FOUND - True if libopus found.
2022-02-28 21:53:36 -05:00
if(OPUS_INCLUDE_DIR AND OPUS_LIBRARY)
2019-01-08 22:27:42 -05:00
# Already in cache, be silent
set(OPUS_FIND_QUIETLY TRUE)
2022-02-28 21:53:36 -05:00
endif(OPUS_INCLUDE_DIR AND OPUS_LIBRARY)
2019-01-08 22:27:42 -05:00
find_path(OPUS_INCLUDE_DIR
2022-02-28 21:53:36 -05:00
NAMES opus.h
2019-01-08 22:27:42 -05:00
PATH_SUFFIXES opus include/opus include
)
# MSVC built opus may be named opus_static
# The provided project files name the library with the lib prefix.
find_library(OPUS_LIBRARY
NAMES opus opus_static libopus libopus_static
PATH_SUFFIXES lib64 lib libs64 libs
)
# Handle the QUIETLY and REQUIRED arguments and set OPUS_FOUND
# to TRUE if all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPUS DEFAULT_MSG
2022-02-28 21:53:36 -05:00
OPUS_LIBRARY OPUS_INCLUDE_DIR
2019-01-08 22:27:42 -05:00
)
if(OPUS_FOUND)
2022-02-28 21:53:36 -05:00
set(OPUS_LIBRARIES ${OPUS_LIBRARY})
2019-01-08 22:27:42 -05:00
set(OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR})
add_library(opus::opus UNKNOWN IMPORTED)
set_target_properties(opus::opus PROPERTIES
2022-02-28 21:53:36 -05:00
IMPORTED_LOCATION "${OPUS_LIBRARY}")
2019-01-08 22:27:42 -05:00
set_target_properties(opus::opus PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${OPUS_INCLUDE_DIRS}
)
endif(OPUS_FOUND)