[cosmetic] separate c-lang format commit
[xbmc.git] / cmake / modules / FindVDPAU.cmake
blobbb19a5439383ddacfc554d1c2a2bc4d4c212c161
1 #.rst:
2 # FindVDPAU
3 # ---------
4 # Finds the VDPAU library
6 # This will define the following target:
8 #   ${APP_NAME_LC}::VDPAU   - The VDPAU library
10 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
11   find_package(PkgConfig)
12   if(PKG_CONFIG_FOUND)
13     pkg_check_modules(PC_VDPAU vdpau QUIET)
14   endif()
16   find_path(VDPAU_INCLUDE_DIR NAMES vdpau/vdpau.h vdpau/vdpau_x11.h
17                               HINTS ${PC_VDPAU_INCLUDEDIR})
18   find_library(VDPAU_LIBRARY NAMES vdpau
19                              HINTS ${PC_VDPAU_LIBDIR})
21   set(VDPAU_VERSION ${PC_VDPAU_VERSION})
23   include(FindPackageHandleStandardArgs)
24   find_package_handle_standard_args(VDPAU
25                                     REQUIRED_VARS VDPAU_LIBRARY VDPAU_INCLUDE_DIR
26                                     VERSION_VAR VDPAU_VERSION)
28   if(VDPAU_FOUND)
29     add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED)
30     set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
31                                                                      IMPORTED_LOCATION "${VDPAU_LIBRARY}"
32                                                                      INTERFACE_INCLUDE_DIRECTORIES "${VDPAU_INCLUDE_DIR}"
33                                                                      INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVDPAU)
34   endif()
35 endif()