-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(linux) make vaapi optional without dlopen (#1979)
Co-authored-by: ReenigneArcher <[email protected]>
- Loading branch information
1 parent
0dff8b1
commit bc6cc20
Showing
10 changed files
with
136 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# - Try to find Libva | ||
# This module defines the following variables: | ||
# | ||
# * LIBVA_FOUND - The component was found | ||
# * LIBVA_INCLUDE_DIRS - The component include directory | ||
# * LIBVA_LIBRARIES - The component library Libva | ||
# * LIBVA_DRM_LIBRARIES - The component library Libva DRM | ||
|
||
# Use pkg-config to get the directories and then use these values in the | ||
# find_path() and find_library() calls | ||
# cmake-format: on | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PKG_CONFIG_FOUND) | ||
pkg_check_modules(_LIBVA libva) | ||
pkg_check_modules(_LIBVA_DRM libva-drm) | ||
endif() | ||
|
||
find_path( | ||
LIBVA_INCLUDE_DIR | ||
NAMES va/va.h va/va_drm.h | ||
HINTS ${_LIBVA_INCLUDE_DIRS} | ||
PATHS /usr/include /usr/local/include /opt/local/include) | ||
|
||
find_library( | ||
LIBVA_LIB | ||
NAMES ${_LIBVA_LIBRARIES} libva | ||
HINTS ${_LIBVA_LIBRARY_DIRS} | ||
PATHS /usr/lib /usr/local/lib /opt/local/lib) | ||
|
||
find_library( | ||
LIBVA_DRM_LIB | ||
NAMES ${_LIBVA_DRM_LIBRARIES} libva-drm | ||
HINTS ${_LIBVA_DRM_LIBRARY_DIRS} | ||
PATHS /usr/lib /usr/local/lib /opt/local/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Libva REQUIRED_VARS LIBVA_INCLUDE_DIR LIBVA_LIB LIBVA_DRM_LIB) | ||
mark_as_advanced(LIBVA_INCLUDE_DIR LIBVA_LIB LIBVA_DRM_LIB) | ||
|
||
if(LIBVA_FOUND) | ||
set(LIBVA_INCLUDE_DIRS ${LIBVA_INCLUDE_DIR}) | ||
set(LIBVA_LIBRARIES ${LIBVA_LIB}) | ||
set(LIBVA_DRM_LIBRARIES ${LIBVA_DRM_LIB}) | ||
|
||
if(NOT TARGET Libva::va) | ||
if(IS_ABSOLUTE "${LIBVA_LIBRARIES}") | ||
add_library(Libva::va UNKNOWN IMPORTED) | ||
set_target_properties(Libva::va PROPERTIES IMPORTED_LOCATION "${LIBVA_LIBRARIES}") | ||
else() | ||
add_library(Libva::va INTERFACE IMPORTED) | ||
set_target_properties(Libva::va PROPERTIES IMPORTED_LIBNAME "${LIBVA_LIBRARIES}") | ||
endif() | ||
|
||
set_target_properties(Libva::va PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBVA_INCLUDE_DIRS}") | ||
endif() | ||
|
||
if(NOT TARGET Libva::drm) | ||
if(IS_ABSOLUTE "${LIBVA_DRM_LIBRARIES}") | ||
add_library(Libva::drm UNKNOWN IMPORTED) | ||
set_target_properties(Libva::drm PROPERTIES IMPORTED_LOCATION "${LIBVA_DRM_LIBRARIES}") | ||
else() | ||
add_library(Libva::drm INTERFACE IMPORTED) | ||
set_target_properties(Libva::drm PROPERTIES IMPORTED_LIBNAME "${LIBVA_DRM_LIBRARIES}") | ||
endif() | ||
|
||
set_target_properties(Libva::drm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBVA_INCLUDE_DIRS}") | ||
endif() | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.