summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindVDPAU.cmake
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
committermanuel <manuel@mausz.at>2017-06-04 16:57:49 +0200
commitf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch)
treed8de60fc7e17edeb6f0921726c038ee54b281445 /cmake/modules/FindVDPAU.cmake
parentae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff)
downloadkodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2
kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip
sync with upstream
Diffstat (limited to 'cmake/modules/FindVDPAU.cmake')
-rw-r--r--cmake/modules/FindVDPAU.cmake47
1 files changed, 47 insertions, 0 deletions
diff --git a/cmake/modules/FindVDPAU.cmake b/cmake/modules/FindVDPAU.cmake
new file mode 100644
index 0000000..b99e03f
--- /dev/null
+++ b/cmake/modules/FindVDPAU.cmake
@@ -0,0 +1,47 @@
1#.rst:
2# FindVDPAU
3# ---------
4# Finds the VDPAU library
5#
6# This will will define the following variables::
7#
8# VDPAU_FOUND - system has VDPAU
9# VDPAU_INCLUDE_DIRS - the VDPAU include directory
10# VDPAU_LIBRARIES - the VDPAU libraries
11# VDPAU_DEFINITIONS - the VDPAU definitions
12#
13# and the following imported targets::
14#
15# VDPAU::VDPAU - The VDPAU library
16
17if(PKG_CONFIG_FOUND)
18 pkg_check_modules(PC_VDPAU vdpau QUIET)
19endif()
20
21find_path(VDPAU_INCLUDE_DIR NAMES vdpau/vdpau.h vdpau/vdpau_x11.h
22 PATHS ${PC_VDPAU_INCLUDEDIR})
23find_library(VDPAU_LIBRARY NAMES vdpau
24 PATHS ${PC_VDPAU_LIBDIR})
25
26set(VDPAU_VERSION ${PC_VDPAU_VERSION})
27
28include(FindPackageHandleStandardArgs)
29find_package_handle_standard_args(VDPAU
30 REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR
31 VERSION_VAR VDPAU_VERSION)
32
33if(VDPAU_FOUND)
34 set(VDPAU_INCLUDE_DIRS ${VDPAU_INCLUDE_DIR})
35 set(VDPAU_LIBRARIES ${VDPAU_LIBRARY})
36 set(VDPAU_DEFINITIONS -DHAVE_LIBVDPAU=1)
37
38 if(NOT TARGET VDPAU::VDPAU)
39 add_library(VDPAU::VDPAU UNKNOWN IMPORTED)
40 set_target_properties(VDPAU::VDPAU PROPERTIES
41 IMPORTED_LOCATION "${VDPAU_LIBRARY}"
42 INTERFACE_INCLUDE_DIRECTORIES "${VDPAU_INCLUDE_DIR}"
43 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVDPAU=1)
44 endif()
45endif()
46
47mark_as_advanced(VDPAU_INCLUDE_DIR VDPAU_LIBRARY)