summaryrefslogtreecommitdiffstats
path: root/project/cmake/modules/FindVAAPI.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/modules/FindVAAPI.cmake')
-rw-r--r--project/cmake/modules/FindVAAPI.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/project/cmake/modules/FindVAAPI.cmake b/project/cmake/modules/FindVAAPI.cmake
index 08e821f..ce3fe1a 100644
--- a/project/cmake/modules/FindVAAPI.cmake
+++ b/project/cmake/modules/FindVAAPI.cmake
@@ -9,6 +9,10 @@
9# VAAPI_INCLUDE_DIRS - the VAAPI include directory 9# VAAPI_INCLUDE_DIRS - the VAAPI include directory
10# VAAPI_LIBRARIES - the VAAPI libraries 10# VAAPI_LIBRARIES - the VAAPI libraries
11# VAAPI_DEFINITIONS - the VAAPI definitions 11# VAAPI_DEFINITIONS - the VAAPI definitions
12#
13# and the following imported targets::
14#
15# VAAPI::VAAPI - The VAAPI library
12 16
13if(PKG_CONFIG_FOUND) 17if(PKG_CONFIG_FOUND)
14 pkg_check_modules(PC_VAAPI libva libva-x11 QUIET) 18 pkg_check_modules(PC_VAAPI libva libva-x11 QUIET)
@@ -42,6 +46,20 @@ if(VAAPI_FOUND)
42 set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR}) 46 set(VAAPI_INCLUDE_DIRS ${VAAPI_INCLUDE_DIR})
43 set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY}) 47 set(VAAPI_LIBRARIES ${VAAPI_libva_LIBRARY} ${VAAPI_libva-x11_LIBRARY})
44 set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1) 48 set(VAAPI_DEFINITIONS -DHAVE_LIBVA=1)
49
50 if(NOT TARGET VAAPI::VAAPI_X11)
51 add_library(VAAPI::VAAPI_X11 UNKNOWN IMPORTED)
52 set_target_properties(VAAPI::VAAPI_X11 PROPERTIES
53 IMPORTED_LOCATION "${VAAPI_libva-x11_LIBRARY}")
54 endif()
55 if(NOT TARGET VAAPI::VAAPI)
56 add_library(VAAPI::VAAPI UNKNOWN IMPORTED)
57 set_target_properties(VAAPI::VAAPI PROPERTIES
58 IMPORTED_LOCATION "${VAAPI_libva_LIBRARY}"
59 INTERFACE_INCLUDE_DIRECTORIES "${VAAPI_INCLUDE_DIR}"
60 INTERFACE_COMPILE_DEFINITIONS HAVE_LIBVA=1
61 INTERFACE_LINK_LIBRARIES VAAPI::VAAPI_X11)
62 endif()
45endif() 63endif()
46 64
47mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY) 65mark_as_advanced(VAAPI_INCLUDE_DIR VAAPI_libva_LIBRARY VAAPI_libva-x11_LIBRARY)