2017-10-25 14:57:25 +00:00
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_OPUSFILE opusfile)
|
|
|
|
endif()
|
2017-02-28 23:51:22 +00:00
|
|
|
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_lib(OPUSFILE opus)
|
2017-02-28 23:51:22 +00:00
|
|
|
find_library(OPUSFILE_LIBRARY
|
|
|
|
NAMES opusfile
|
2017-07-31 16:30:24 +00:00
|
|
|
HINTS ${HINTS_OPUSFILE_LIBDIR} ${PC_OPUSFILE_LIBDIR} ${PC_OPUSFILE_LIBRARY_DIRS}
|
|
|
|
PATHS ${PATHS_OPUSFILE_LIBDIR}
|
2017-10-25 14:57:25 +00:00
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
2017-02-28 23:51:22 +00:00
|
|
|
)
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_include(OPUSFILE opus "${OPUSFILE_LIBRARY}")
|
|
|
|
find_path(OPUSFILE_INCLUDEDIR opusfile.h
|
|
|
|
PATH_SUFFIXES opus
|
|
|
|
HINTS ${HINTS_OPUSFILE_INCLUDEDIR} ${PC_OPUSFILE_INCLUDEDIR} ${PC_OPUSFILE_INCLUDE_DIRS}
|
|
|
|
PATHS ${PATHS_OPUSFILE_INCLUDEDIR}
|
2017-10-25 14:57:25 +00:00
|
|
|
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
2017-10-24 10:10:46 +00:00
|
|
|
)
|
2017-02-23 13:16:32 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2017-02-28 23:51:22 +00:00
|
|
|
find_package_handle_standard_args(Opusfile DEFAULT_MSG OPUSFILE_LIBRARY OPUSFILE_INCLUDEDIR)
|
|
|
|
|
|
|
|
mark_as_advanced(OPUSFILE_LIBRARY OPUSFILE_INCLUDEDIR)
|
|
|
|
|
|
|
|
set(OPUSFILE_LIBRARIES ${OPUSFILE_LIBRARY})
|
|
|
|
set(OPUSFILE_INCLUDE_DIRS ${OPUSFILE_INCLUDEDIR})
|
2017-03-07 14:24:08 +00:00
|
|
|
|
2018-02-12 22:14:14 +00:00
|
|
|
if(OPUSFILE_FOUND)
|
|
|
|
is_bundled(OPUSFILE_BUNDLED "${OPUSFILE_LIBRARY}")
|
|
|
|
if(OPUSFILE_BUNDLED AND TARGET_OS STREQUAL "windows")
|
2024-07-23 05:23:36 +00:00
|
|
|
if (TARGET_CPU_ARCHITECTURE STREQUAL "arm64")
|
|
|
|
set(OPUSFILE_COPY_FILES
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libopusfile-0.dll"
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libopus-0.dll"
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libogg-0.dll"
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libwinpthread-1.dll"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(OPUSFILE_COPY_FILES
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libogg.dll"
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libopus.dll"
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libopusfile.dll"
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libwinpthread-1.dll"
|
|
|
|
)
|
|
|
|
endif()
|
2018-02-12 22:14:14 +00:00
|
|
|
if(TARGET_BITS EQUAL 32)
|
|
|
|
list(APPEND OPUSFILE_COPY_FILES
|
|
|
|
"${EXTRA_OPUSFILE_LIBDIR}/libgcc_s_sjlj-1.dll"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(OPUSFILE_COPY_FILES)
|
2017-07-20 21:52:25 +00:00
|
|
|
endif()
|
2017-03-07 14:24:08 +00:00
|
|
|
endif()
|