summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-05-05 22:11:16 +0200
committerSebastian Dröge <slomo@coaxion.net>2019-05-06 07:21:45 +0000
commit22c6a4085f8792d8af0cdabfe1664d55ca2dee11 (patch)
tree00fd4a893a2cb36470464730355c623784fe9198
parent3c8a916501670909aa4cc4f8f46cfd2396b38285 (diff)
meson: fix build with opencv=enabled and opencv4. Fixes #964
Having the opencv feature enabled would lead to the opencv3 dependency being required which failed with only opencv4 being available. Instead don't require anything and error out at the end if the feature was enabled but no dependency was found.
-rw-r--r--gst-libs/gst/opencv/meson.build6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst-libs/gst/opencv/meson.build b/gst-libs/gst/opencv/meson.build
index 3fd472fda..8dc2ad99b 100644
--- a/gst-libs/gst/opencv/meson.build
+++ b/gst-libs/gst/opencv/meson.build
@@ -9,9 +9,9 @@ opencv_headers = [
'gstopencvvideofilter.h',
]
-opencv_dep = dependency('opencv', version : '>= 3.0.0', required : get_option('opencv'))
+opencv_dep = dependency('opencv', version : '>= 3.0.0', required : false)
if not opencv_dep.found()
- opencv_dep = dependency('opencv4', version : '>= 4.0.0', required : get_option('opencv'))
+ opencv_dep = dependency('opencv4', version : '>= 4.0.0', required : false)
endif
if opencv_dep.found()
gstopencv = library('gstopencv-' + api_version,
@@ -30,4 +30,6 @@ if opencv_dep.found()
dependencies : [gstvideo_dep, opencv_dep])
install_headers(opencv_headers, subdir : 'gstreamer-1.0/gst/opencv')
+elif get_option('opencv').enabled()
+ error('OpenCV support enabled but required dependencies were not found.')
endif