From b619477be940533df3662a0df2c2153dcacf1c3c Mon Sep 17 00:00:00 2001 From: Dmitry Matveev Date: Thu, 27 Oct 2022 18:25:36 +0000 Subject: [PATCH] Fix issues with VA_INCLUDE_HEADERS when building with CUDA support ...and not only? --- modules/gapi/CMakeLists.txt | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/modules/gapi/CMakeLists.txt b/modules/gapi/CMakeLists.txt index 66a559bf7f..2a9d598bb8 100644 --- a/modules/gapi/CMakeLists.txt +++ b/modules/gapi/CMakeLists.txt @@ -328,18 +328,13 @@ if(HAVE_GAPI_ONEVPL) ocv_target_include_directories(${the_module} SYSTEM PRIVATE ${OPENCL_INCLUDE_DIRS}) endif() - if(UNIX) - if(WITH_VA) - include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindVA.cmake") - if(VA_INCLUDE_DIR) - ocv_target_include_directories(${the_module} SYSTEM PRIVATE ${VA_INCLUDE_DIR}) - ocv_target_include_directories(opencv_test_gapi SYSTEM PRIVATE ${VA_INCLUDE_DIR}) - ocv_target_link_libraries(${the_module} PRIVATE ${VA_LIBRARIES}) - ocv_target_link_libraries(opencv_test_gapi PRIVATE ${VA_LIBRARIES}) - endif() - else(WITH_VA) - message(FATAL_ERROR "libva not found: building HAVE_GAPI_ONEVPL without libVA support is impossible on UNIX systems") - endif(WITH_VA) + if(UNIX AND HAVE_VA) + ocv_target_include_directories(${the_module} SYSTEM PRIVATE ${VA_INCLUDE_DIR}) + ocv_target_link_libraries(${the_module} PRIVATE ${VA_LIBRARIES}) + if(TARGET opencv_test_gapi) + ocv_target_include_directories(opencv_test_gapi SYSTEM PRIVATE ${VA_INCLUDE_DIR}) + ocv_target_link_libraries(opencv_test_gapi PRIVATE ${VA_LIBRARIES}) + endif() endif() endif() @@ -382,7 +377,7 @@ if(TARGET example_gapi_onevpl_infer_single_roi) if(HAVE_D3D11 AND HAVE_OPENCL) ocv_target_include_directories(example_gapi_onevpl_infer_single_roi SYSTEM PRIVATE ${OPENCL_INCLUDE_DIRS}) endif() - if(WITH_VA AND UNIX) + if(UNIX AND HAVE_VA) message ("GAPI VPL samples with VAAPI") ocv_target_include_directories(example_gapi_onevpl_infer_single_roi SYSTEM PRIVATE ${VA_INCLUDE_DIR}) ocv_target_link_libraries(example_gapi_onevpl_infer_single_roi PRIVATE ${VA_LIBRARIES})