2022-07-09 14:01:49 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
2024-01-24 11:34:08 +00:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_TREMOR QUIET vorbisidec)
|
|
|
|
|
2022-07-09 14:01:49 +00:00
|
|
|
find_library(tremor_LIBRARY
|
|
|
|
NAMES vorbisidec libvorbisidec
|
2024-01-24 11:34:08 +00:00
|
|
|
HINTS ${PC_TREMOR_LIBDIR}
|
2022-07-09 14:01:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
find_path(tremor_INCLUDE_PATH
|
|
|
|
NAMES tremor/ivorbisfile.h
|
2024-01-24 11:34:08 +00:00
|
|
|
HINTS ${PC_TREMOR_INCLUDEDIR}
|
2022-07-09 14:01:49 +00:00
|
|
|
)
|
|
|
|
|
2024-01-24 11:34:08 +00:00
|
|
|
if(PC_TREMOR_FOUND)
|
|
|
|
get_flags_from_pkg_config("${tremor_LIBRARY}" "PC_TREMOR" "_tremor")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(tremor_COMPILE_OPTIONS "${_tremor_compile_options}" CACHE STRING "Extra compile options of vorbis")
|
|
|
|
|
|
|
|
set(tremor_LINK_LIBRARIES "${_tremor_link_libraries}" CACHE STRING "Extra link libraries of vorbis")
|
2022-07-09 14:01:49 +00:00
|
|
|
|
2024-01-24 11:34:08 +00:00
|
|
|
set(tremor_LINK_OPTIONS "${_tremor_link_options}" CACHE STRING "Extra link flags of vorbis")
|
2022-07-09 14:01:49 +00:00
|
|
|
|
2024-01-24 11:34:08 +00:00
|
|
|
set(tremor_LINK_DIRECTORIES "${_tremor_link_directories}" CACHE PATH "Extra link directories of vorbis")
|
2022-07-09 14:01:49 +00:00
|
|
|
|
|
|
|
find_package_handle_standard_args(tremor
|
|
|
|
REQUIRED_VARS tremor_LIBRARY tremor_INCLUDE_PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
if (tremor_FOUND)
|
|
|
|
if (NOT TARGET tremor::tremor)
|
|
|
|
add_library(tremor::tremor UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(tremor::tremor PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${tremor_LIBRARY}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${tremor_INCLUDE_PATH}"
|
|
|
|
INTERFACE_COMPILE_OPTIONS "${tremor_COMPILE_OPTIONS}"
|
|
|
|
INTERFACE_LINK_LIBRARIES "${tremor_LINK_LIBRARIES}"
|
2024-01-24 11:34:08 +00:00
|
|
|
INTERFACE_LINK_OPTIONS "${tremor_LINK_OPTIONS}"
|
|
|
|
INTERFACE_LINK_DIRECTORIES "${tremor_LINK_DIRECTORIES}"
|
2022-07-09 14:01:49 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|