From 8cdf8dec703d882b46ca50a769fabb95ffc48e2c Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 24 Nov 2016 21:27:41 +0100 Subject: sync with upstream --- project/cmake/modules/FindVDPAU.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'project/cmake/modules/FindVDPAU.cmake') diff --git a/project/cmake/modules/FindVDPAU.cmake b/project/cmake/modules/FindVDPAU.cmake index 680b45f..b99e03f 100644 --- a/project/cmake/modules/FindVDPAU.cmake +++ b/project/cmake/modules/FindVDPAU.cmake @@ -9,6 +9,10 @@ # VDPAU_INCLUDE_DIRS - the VDPAU include directory # VDPAU_LIBRARIES - the VDPAU libraries # VDPAU_DEFINITIONS - the VDPAU definitions +# +# and the following imported targets:: +# +# VDPAU::VDPAU - The VDPAU library if(PKG_CONFIG_FOUND) pkg_check_modules(PC_VDPAU vdpau QUIET) @@ -19,14 +23,25 @@ find_path(VDPAU_INCLUDE_DIR NAMES vdpau/vdpau.h vdpau/vdpau_x11.h find_library(VDPAU_LIBRARY NAMES vdpau PATHS ${PC_VDPAU_LIBDIR}) +set(VDPAU_VERSION ${PC_VDPAU_VERSION}) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VDPAU - REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR) + REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR + VERSION_VAR VDPAU_VERSION) if(VDPAU_FOUND) set(VDPAU_INCLUDE_DIRS ${VDPAU_INCLUDE_DIR}) set(VDPAU_LIBRARIES ${VDPAU_LIBRARY}) set(VDPAU_DEFINITIONS -DHAVE_LIBVDPAU=1) + + if(NOT TARGET VDPAU::VDPAU) + add_library(VDPAU::VDPAU UNKNOWN IMPORTED) + set_target_properties(VDPAU::VDPAU PROPERTIES + IMPORTED_LOCATION "${VDPAU_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${VDPAU_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVDPAU=1) + endif() endif() mark_as_advanced(VDPAU_INCLUDE_DIR VDPAU_LIBRARY) -- cgit v1.2.3