mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 19:02:48 +00:00

note that the first release of MPV is v0.2.2: https://github.com/mpv-player/mpv/tags?after=v0.3.7 on OpenBSD it is 0.2.0 in the pkg-config file and I do not think that will change anytime soon, it has been like this since atleast OpenBSD v7.0 and if I remember correctly even before that Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
45 lines
1.2 KiB
CMake
45 lines
1.2 KiB
CMake
# Try to find MPV, once done this will define:
|
|
#
|
|
# MPV_FOUND - system has MPV
|
|
# MPV_INCLUDES - the MPV include directory
|
|
# MPV_LIBRARIES - the libraries needed to use MPV
|
|
#
|
|
# Copyright (c) 2015 Ivailo Monev <xakepa10@gmail.com>
|
|
#
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
if(NOT WIN32)
|
|
include(FindPkgConfig)
|
|
pkg_check_modules(PC_MPV QUIET mpv)
|
|
|
|
set(MPV_INCLUDES ${PC_MPV_INCLUDE_DIRS})
|
|
set(MPV_LIBRARIES ${PC_MPV_LIBRARIES})
|
|
endif()
|
|
|
|
set(MPV_VERSION ${PC_MPV_VERSION})
|
|
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()
|
|
|
|
if(NOT MPV_INCLUDES OR NOT MPV_LIBRARIES)
|
|
find_path(MPV_INCLUDES
|
|
NAMES client.h
|
|
PATH_SUFFIXES mpv
|
|
HINTS $ENV{MPVDIR}/include
|
|
)
|
|
|
|
find_library(MPV_LIBRARIES
|
|
NAMES mpv
|
|
HINTS $ENV{MPVDIR}/lib
|
|
)
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(MPV
|
|
VERSION_VAR MPV_VERSION
|
|
REQUIRED_VARS MPV_LIBRARIES MPV_INCLUDES
|
|
)
|
|
|
|
mark_as_advanced(MPV_INCLUDES MPV_LIBRARIES)
|