2016-03-14 21:37:05 +00:00
|
|
|
# - Try to find MPV
|
2020-02-10 20:40:01 +00:00
|
|
|
#
|
2016-03-14 21:37:05 +00:00
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# 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
|
|
|
#
|
2020-02-08 16:05:03 +00:00
|
|
|
# Copyright (c) 2015-2020, 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
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_MPV QUIET mpv)
|
2020-02-10 20:40:01 +00:00
|
|
|
|
|
|
|
set(MPV_INCLUDES ${PC_MPV_INCLUDE_DIRS})
|
|
|
|
set(MPV_LIBRARIES ${PC_MPV_LIBRARIES})
|
2016-03-14 21:37:05 +00:00
|
|
|
endif()
|
|
|
|
|
2020-02-18 15:53:03 +00:00
|
|
|
set(MPV_VERSION ${PC_MPV_VERSION})
|
|
|
|
|
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-08 16:05:03 +00:00
|
|
|
mark_as_advanced(MPV_INCLUDES MPV_LIBRARIES)
|