-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
5b1bc06
commit c097734
Showing
12 changed files
with
627 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# - Find FLAC | ||
# Find the native FLAC includes and libraries | ||
# | ||
# FLAC_INCLUDE_DIRS - where to find FLAC headers. | ||
# FLAC_LIBRARIES - List of libraries when using libFLAC. | ||
# FLAC_FOUND - True if libFLAC found. | ||
# FLAC_DEFINITIONS - FLAC compile definitons | ||
|
||
if (FLAC_INCLUDE_DIR) | ||
# Already in cache, be silent | ||
set (FLAC_FIND_QUIETLY TRUE) | ||
endif () | ||
|
||
find_package (Ogg QUIET) | ||
|
||
find_package (PkgConfig QUIET) | ||
pkg_check_modules(PC_FLAC QUIET flac) | ||
|
||
set(FLAC_VERSION ${PC_FLAC_VERSION}) | ||
|
||
find_path (FLAC_INCLUDE_DIR FLAC/stream_decoder.h | ||
HINTS | ||
${PC_FLAC_INCLUDEDIR} | ||
${PC_FLAC_INCLUDE_DIRS} | ||
${FLAC_ROOT} | ||
) | ||
|
||
# MSVC built libraries can name them *_static, which is good as it | ||
# distinguishes import libraries from static libraries with the same extension. | ||
find_library (FLAC_LIBRARY | ||
NAMES | ||
FLAC | ||
libFLAC | ||
libFLAC_dynamic | ||
libFLAC_static | ||
HINTS | ||
${PC_FLAC_LIBDIR} | ||
${PC_FLAC_LIBRARY_DIRS} | ||
${FLAC_ROOT} | ||
) | ||
|
||
# Handle the QUIETLY and REQUIRED arguments and set FLAC_FOUND to TRUE if | ||
# all listed variables are TRUE. | ||
include (FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args (FLAC | ||
REQUIRED_VARS | ||
FLAC_LIBRARY | ||
FLAC_INCLUDE_DIR | ||
Ogg_FOUND | ||
VERSION_VAR | ||
FLAC_VERSION | ||
) | ||
|
||
if (FLAC_FOUND) | ||
set (FLAC_INCLUDE_DIRS ${FLAC_INCLUDE_DIR}) | ||
set (FLAC_LIBRARIES ${FLAC_LIBRARY} ${OGG_LIBRARIES}) | ||
if (NOT TARGET FLAC::FLAC) | ||
add_library(FLAC::FLAC UNKNOWN IMPORTED) | ||
set_target_properties(FLAC::FLAC PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_DIR}" | ||
IMPORTED_LOCATION "${FLAC_LIBRARY}" | ||
INTERFACE_LINK_LIBRARIES Ogg::ogg | ||
) | ||
endif () | ||
endif () | ||
|
||
mark_as_advanced(FLAC_INCLUDE_DIR FLAC_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,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,67 @@ | ||
# - Find opus | ||
# Find the native opus includes and libraries | ||
# | ||
# OPUS_INCLUDE_DIRS - where to find opus.h, etc. | ||
# OPUS_LIBRARIES - List of libraries when using opus. | ||
# OPUS_FOUND - True if Opus found. | ||
|
||
if (OPUS_INCLUDE_DIR) | ||
# Already in cache, be silent | ||
set(OPUS_FIND_QUIETLY TRUE) | ||
endif () | ||
|
||
find_package (Ogg QUIET) | ||
|
||
find_package (PkgConfig QUIET) | ||
pkg_check_modules(PC_OPUS QUIET opus>=1.1) | ||
|
||
set (OPUS_VERSION ${PC_OPUS_VERSION}) | ||
|
||
find_path (OPUS_INCLUDE_DIR opus/opus.h | ||
HINTS | ||
${PC_OPUS_INCLUDEDIR} | ||
${PC_OPUS_INCLUDE_DIRS} | ||
${OPUS_ROOT} | ||
) | ||
|
||
# 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 | ||
HINTS | ||
${PC_OPUS_LIBDIR} | ||
${PC_OPUS_LIBRARY_DIRS} | ||
${OPUS_ROOT} | ||
) | ||
|
||
# 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 | ||
REQUIRED_VARS | ||
OPUS_LIBRARY | ||
OPUS_INCLUDE_DIR | ||
OGG_FOUND | ||
VERSION_VAR | ||
OPUS_VERSION | ||
) | ||
|
||
if (OPUS_FOUND) | ||
set (OPUS_LIBRARIES ${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 () | ||
|
||
mark_as_advanced(OPUS_INCLUDE_DIR OPUS_LIBRARY) |
Oops, something went wrong.