mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
94818ec1f0
Allow for newer versions of Wavpack, fixes #1023. Fixes #1016.
34 lines
903 B
CMake
34 lines
903 B
CMake
if(NOT CMAKE_CROSSCOMPILING)
|
|
find_package(PkgConfig QUIET)
|
|
pkg_check_modules(PC_OPUS opus)
|
|
endif()
|
|
|
|
set_extra_dirs_lib(OPUS opus)
|
|
find_library(OPUS_LIBRARY
|
|
NAMES opus
|
|
HINTS ${HINTS_OPUS_LIBDIR} ${PC_OPUS_LIBDIR} ${PC_OPUS_LIBRARY_DIRS}
|
|
PATHS ${PATHS_OPUS_LIBDIR}
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
|
)
|
|
set_extra_dirs_include(OPUS opus "${OPUS_LIBRARY}")
|
|
find_path(OPUS_INCLUDEDIR opus.h
|
|
PATH_SUFFIXES opus
|
|
HINTS ${HINTS_OPUS_INCLUDEDIR} ${PC_OPUS_INCLUDEDIR} ${PC_OPUS_INCLUDE_DIRS}
|
|
PATHS ${PATHS_OPUS_INCLUDEDIR}
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
|
)
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(Opus DEFAULT_MSG OPUS_INCLUDEDIR)
|
|
|
|
mark_as_advanced(OPUS_INCLUDEDIR OPUS_LIBRARY)
|
|
|
|
if(OPUS_FOUND)
|
|
set(OPUS_INCLUDE_DIRS ${OPUS_INCLUDEDIR})
|
|
if(OPUS_LIBRARY)
|
|
set(OPUS_LIBRARIES ${OPUS_LIBRARY})
|
|
else()
|
|
set(OPUS_LIBRARIES)
|
|
endif()
|
|
endif()
|