-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
532 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# - Find ogg | ||
# Find the native ogg includes and libraries | ||
# | ||
# OGG_INCLUDE_DIRS - where to find ogg.h, etc. | ||
# OGG_LIBRARIES - List of libraries when using ogg. | ||
# OGG_FOUND - True if ogg found. | ||
|
||
if (OGG_INCLUDE_DIR) | ||
# Already in cache, be silent | ||
set(OGG_FIND_QUIETLY TRUE) | ||
endif () | ||
|
||
find_package (PkgConfig QUIET) | ||
pkg_check_modules (PC_OGG QUIET ogg>=1.3.0) | ||
|
||
set (OGG_VERSION ${PC_OGG_VERSION}) | ||
|
||
find_path (OGG_INCLUDE_DIR ogg/ogg.h | ||
HINTS | ||
${PC_OGG_INCLUDEDIR} | ||
${PC_OGG_INCLUDE_DIRS} | ||
${OGG_ROOT} | ||
) | ||
# MSVC built ogg may be named ogg_static. | ||
# The provided project files name the library with the lib prefix. | ||
find_library (OGG_LIBRARY | ||
NAMES | ||
ogg | ||
ogg_static | ||
libogg | ||
libogg_static | ||
HINTS | ||
${PC_OGG_LIBDIR} | ||
${PC_OGG_LIBRARY_DIRS} | ||
${OGG_ROOT} | ||
) | ||
# Handle the QUIETLY and REQUIRED arguments and set OGG_FOUND | ||
# to TRUE if all listed variables are TRUE. | ||
include (FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args (Ogg | ||
REQUIRED_VARS | ||
OGG_LIBRARY | ||
OGG_INCLUDE_DIR | ||
VERSION_VAR | ||
OGG_VERSION | ||
) | ||
|
||
if (OGG_FOUND) | ||
set (OGG_LIBRARIES ${OGG_LIBRARY}) | ||
set (OGG_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) | ||
|
||
if(NOT TARGET Ogg::ogg) | ||
add_library(Ogg::ogg UNKNOWN IMPORTED) | ||
set_target_properties(Ogg::ogg PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIRS}" | ||
IMPORTED_LOCATION "${OGG_LIBRARIES}" | ||
) | ||
endif () | ||
endif () | ||
|
||
mark_as_advanced (OGG_INCLUDE_DIR OGG_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# - 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. | ||
|
||
if(OPUS_INCLUDE_DIR AND OPUS_LIBRARY AND OPUSFILE_LIBRARY) | ||
# Already in cache, be silent | ||
set(OPUS_FIND_QUIETLY TRUE) | ||
endif(OPUS_INCLUDE_DIR AND OPUS_LIBRARY AND OPUSFILE_LIBRARY) | ||
|
||
find_path(OPUS_INCLUDE_DIR | ||
NAMES opusfile.h | ||
PATH_SUFFIXES opus | ||
) | ||
|
||
# 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 | ||
) | ||
find_library(OPUSFILE_LIBRARY | ||
NAMES opusfile opusfile_static libopusfile libopusfile_static | ||
) | ||
|
||
# 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 | ||
OPUSFILE_LIBRARY OPUS_LIBRARY OPUS_INCLUDE_DIR | ||
) | ||
|
||
if(OPUS_FOUND) | ||
set(OPUS_LIBRARIES ${OPUSFILE_LIBRARY} ${OPUS_LIBRARY}) | ||
set(OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR}) | ||
if(NOT TARGET Opus::opus) | ||
add_library(Opus::opus UNKNOWN IMPORTED) | ||
set_target_properties(Opus::opus PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${OPUS_INCLUDE_DIRS}" | ||
IMPORTED_LOCATION "${OPUS_LIBRARIES}" | ||
) | ||
endif() | ||
endif(OPUS_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# FindOpusenc.cmake | ||
# This module locates the opusenc library and its headers. | ||
# It defines the following variables: | ||
# - Opusenc_FOUND: Boolean indicating if opusenc was found | ||
# - Opusenc_INCLUDE_DIRS: Include directories for opusenc | ||
# - Opusenc_LIBRARIES: Libraries to link against opusenc | ||
# - Opusenc_VERSION: Version of the found opusenc library (optional) | ||
|
||
# Locate the opusenc header | ||
find_path(Opusenc_INCLUDE_DIR | ||
NAMES opusenc.h | ||
HINTS | ||
${CMAKE_PREFIX_PATH} | ||
PATH_SUFFIXES | ||
include | ||
opus | ||
) | ||
|
||
# Locate the opusenc library | ||
find_library(Opusenc_LIBRARY | ||
NAMES opusenc | ||
HINTS | ||
${CMAKE_PREFIX_PATH} | ||
PATH_SUFFIXES | ||
lib | ||
) | ||
|
||
# Check if both the library and headers were found | ||
if (Opusenc_INCLUDE_DIR AND Opusenc_LIBRARY) | ||
set(Opusenc_FOUND TRUE) | ||
else () | ||
set(Opusenc_FOUND FALSE) | ||
endif () | ||
|
||
# Provide include directories and libraries if found | ||
if (Opusenc_FOUND) | ||
set(Opusenc_INCLUDE_DIRS ${Opusenc_INCLUDE_DIR}) | ||
set(Opusenc_LIBRARIES ${Opusenc_LIBRARY}) | ||
if(NOT TARGET Opus::opusenc) | ||
add_library(Opus::opusenc UNKNOWN IMPORTED) | ||
set_target_properties(Opus::opusenc PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${Opusenc_INCLUDE_DIRS}" | ||
IMPORTED_LOCATION "${Opusenc_LIBRARIES}" | ||
) | ||
endif() | ||
# Optional: Retrieve library version | ||
set(Opusenc_VERSION "Unknown") # Adjust if version detection is needed | ||
endif () | ||
|
||
# Mark variables as advanced to reduce clutter | ||
mark_as_advanced(Opusenc_INCLUDE_DIR Opusenc_LIBRARY) |
Oops, something went wrong.