From 02ac6ec81c9b31b4783a2763a7565aaeafdd3abe Mon Sep 17 00:00:00 2001
From: Alexander Alekhin <alexander.a.alekhin@gmail.com>
Date: Wed, 8 Dec 2021 10:45:02 +0000
Subject: [PATCH] cmake: option to disable GStreamer in G-API

- OPENCV_GAPI_GSTREAMER
---
 modules/gapi/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gapi/CMakeLists.txt b/modules/gapi/CMakeLists.txt
index cc83606694..a98cfce6e7 100644
--- a/modules/gapi/CMakeLists.txt
+++ b/modules/gapi/CMakeLists.txt
@@ -300,7 +300,8 @@ if(HAVE_GAPI_ONEVPL)
   endif()
 endif()
 
-if(HAVE_GSTREAMER)
+ocv_option(OPENCV_GAPI_GSTREAMER "Build G-API with GStreamer support" HAVE_GSTREAMER)
+if(HAVE_GSTREAMER AND OPENCV_GAPI_GSTREAMER)
   if(TARGET opencv_test_gapi)
     ocv_target_compile_definitions(opencv_test_gapi PRIVATE -DHAVE_GSTREAMER)
     ocv_target_link_libraries(opencv_test_gapi PRIVATE ocv.3rdparty.gstreamer)