diff options
| author | enzu.ru <enzuru@users.noreply.github.com> | 2025-09-18 13:29:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-18 13:29:35 -0700 |
| commit | 577c5639df7d0d92f8fb751f3fefa7e4ed97f264 (patch) | |
| tree | 59e1b64b377454f809523978d98d31b13c28e7e5 /CMake/FindOpusFile.cmake | |
| parent | b944d01b12aacf5e06226538fac2a4badb176359 (diff) | |
Improve Nix support (#5777)
* Fix FindOpusFile NixOS bug
* better documentation
Diffstat (limited to 'CMake/FindOpusFile.cmake')
| -rw-r--r-- | CMake/FindOpusFile.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CMake/FindOpusFile.cmake b/CMake/FindOpusFile.cmake index ed3b4b7ba..c7fcd2fb1 100644 --- a/CMake/FindOpusFile.cmake +++ b/CMake/FindOpusFile.cmake @@ -6,9 +6,16 @@ # OPUSFILE_LIBRARY - Path to the opusfile library # OPUSFILE_LIBRARIES - Full list of libraries to link (opusfile, opus, ogg) +# Use pkg-config to find opusfile if available +find_package(PkgConf) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_OPUSFILE QUIET opusfile) +endif() + # Search for the OpusFile header find_path(OPUSFILE_INCLUDE_DIR NAMES opusfile.h + HINTS ${PC_OPUSFILE_INCLUDE_DIRS} PATHS /usr/include/opus /usr/local/include/opus /opt/local/include/opus /opt/homebrew/include/opus DOC "Directory where opusfile.h is located" ) @@ -16,6 +23,7 @@ find_path(OPUSFILE_INCLUDE_DIR # Search for the OpusFile library find_library(OPUSFILE_LIBRARY NAMES opusfile + HINTS ${PC_OPUSFILE_LIBRARY_DIRS} DOC "Path to the libopusfile library" ) |
