Add: Support sound effects in Ogg Opus format.
This commit is contained in:
committed by
Peter Nelson
parent
8b00661b22
commit
560ee2442d
37
cmake/FindOpus.cmake
Normal file
37
cmake/FindOpus.cmake
Normal file
@@ -0,0 +1,37 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_library(Opus_LIBRARY
|
||||
NAMES opus
|
||||
)
|
||||
|
||||
set(Opus_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of opus")
|
||||
|
||||
set(Opus_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of opus")
|
||||
|
||||
set(Opus_LINK_FLAGS "" CACHE STRING "Extra link flags of opus")
|
||||
|
||||
find_path(Opus_INCLUDE_PATH
|
||||
NAMES opus.h
|
||||
PATH_SUFFIXES opus
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(Opus
|
||||
REQUIRED_VARS Opus_LIBRARY Opus_INCLUDE_PATH
|
||||
)
|
||||
|
||||
if (Opus_FOUND)
|
||||
set(Opus_dirs ${Opus_INCLUDE_PATH})
|
||||
if(EXISTS "${Opus_INCLUDE_PATH}/opus")
|
||||
list(APPEND Opus_dirs "${Opus_INCLUDE_PATH}/opus")
|
||||
endif()
|
||||
if (NOT TARGET Opus::opus)
|
||||
add_library(Opus::opus UNKNOWN IMPORTED)
|
||||
set_target_properties(Opus::opus PROPERTIES
|
||||
IMPORTED_LOCATION "${Opus_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Opus_dirs}"
|
||||
INTERFACE_COMPILE_OPTIONS "${Opus_COMPILE_OPTIONS}"
|
||||
INTERFACE_LINK_LIBRARIES "${Opus_LINK_LIBRARIES}"
|
||||
INTERFACE_LINK_FLAGS "${Opus_LINK_FLAGS}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user