mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-07 16:27:15 +01:00
Create FindOpus.cmake
This commit is contained in:
parent
6422c1aad4
commit
a589fbede0
36
cmake/FindOpus.cmake
Normal file
36
cmake/FindOpus.cmake
Normal file
@ -0,0 +1,36 @@
|
||||
# OPUS_FOUND - system has opus
|
||||
# OPUS_INCLUDE_DIRS - the opus include directory
|
||||
# OPUS_LIBRARIES - The libraries needed to use opus
|
||||
|
||||
find_path(OPUS_INCLUDE_DIRS
|
||||
NAMES opus/opus.h
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
if(OPUS_INCLUDE_DIRS)
|
||||
set(HAVE_OPUS_OPUS_H 1)
|
||||
endif()
|
||||
|
||||
if(OPUS_USE_STATIC_LIBS)
|
||||
find_library(OPUS_LIBRARIES NAMES "libopus.a")
|
||||
else()
|
||||
find_library(OPUS_LIBRARIES NAMES opus)
|
||||
endif()
|
||||
|
||||
if(OPUS_LIBRARIES)
|
||||
if(OPUS_USE_STATIC_LIBS)
|
||||
find_library(LIBM NAMES "libm.a" "libm.tbd")
|
||||
else()
|
||||
find_library(LIBM NAMES m)
|
||||
endif()
|
||||
if(LIBM)
|
||||
list(APPEND OPUS_LIBRARIES ${LIBM})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Opus
|
||||
DEFAULT_MSG
|
||||
OPUS_INCLUDE_DIRS OPUS_LIBRARIES HAVE_OPUS_OPUS_H
|
||||
)
|
||||
|
||||
mark_as_advanced(OPUS_INCLUDE_DIRS OPUS_LIBRARIES HAVE_OPUS_OPUS_H)
|
Loading…
Reference in New Issue
Block a user