2021-03-07 02:40:21 +02:00
|
|
|
# Try to find MPV, once done this will define:
|
2016-03-14 21:37:05 +00:00
|
|
|
#
|
|
|
|
# MPV_FOUND - system has MPV
|
|
|
|
# MPV_INCLUDES - the MPV include directory
|
2020-02-19 20:52:40 +00:00
|
|
|
# MPV_LIBRARIES - the libraries needed to use MPV
|
2016-03-14 21:37:05 +00:00
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2015 Ivailo Monev <xakepa10@gmail.com>
|
2016-03-14 21:37:05 +00:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
2020-02-10 20:40:01 +00:00
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
2016-03-14 21:37:05 +00:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(PC_MPV QUIET mpv)
|
2016-03-14 21:37:05 +00:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
set(MPV_INCLUDES ${PC_MPV_INCLUDE_DIRS})
|
|
|
|
set(MPV_LIBRARIES ${PC_MPV_LIBRARIES})
|
2020-02-18 15:53:03 +00:00
|
|
|
set(MPV_VERSION ${PC_MPV_VERSION})
|
2022-05-02 22:36:30 +03:00
|
|
|
if (MPV_VERSION VERSION_LESS 0.2.2)
|
|
|
|
# workaround for incorrect version in pkg-config file, notably on OpenBSD
|
|
|
|
set(MPV_VERSION 0.23.0)
|
|
|
|
endif()
|
2020-02-18 15:53:03 +00:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT MPV_INCLUDES OR NOT MPV_LIBRARIES)
|
|
|
|
find_path(MPV_INCLUDES
|
|
|
|
NAMES client.h
|
|
|
|
PATH_SUFFIXES mpv
|
|
|
|
HINTS $ENV{MPVDIR}/include
|
|
|
|
)
|
2016-03-14 21:37:05 +00:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
find_library(MPV_LIBRARIES
|
|
|
|
NAMES mpv
|
|
|
|
HINTS $ENV{MPVDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2016-03-14 21:37:05 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-02-08 16:05:03 +00:00
|
|
|
find_package_handle_standard_args(MPV
|
2020-02-18 15:53:03 +00:00
|
|
|
VERSION_VAR MPV_VERSION
|
2020-02-08 16:05:03 +00:00
|
|
|
REQUIRED_VARS MPV_LIBRARIES MPV_INCLUDES
|
|
|
|
)
|
2016-03-14 21:37:05 +00:00
|
|
|
|
2020-02-20 22:06:56 +00:00
|
|
|
mark_as_advanced(MPV_INCLUDES MPV_LIBRARIES)
|