meson: Fix build with new opencv and -Dtracking=enabled

This commit is contained in:
Christoph Haag 2022-03-04 16:27:38 +01:00 committed by Jakob Bornecrantz
parent 7c55c51408
commit 174c6f8bd5

View file

@ -95,9 +95,17 @@ if leap.found()
inc_leap += include_directories('/usr/local/include')
endif
opencv = dependency('opencv', required: get_option('tracking'))
opencv = dependency('opencv', required: false)
if not opencv.found()
opencv = dependency('opencv4', required: get_option('tracking'))
opencv = dependency('opencv4', required: false)
endif
if get_option('tracking').enabled() and not opencv.found()
error('tracking enabled but opencv not found')
endif
if get_option('tracking').auto()
build_tracking = opencv.found()
endif
# Find an external SLAM implementation
@ -109,16 +117,11 @@ foreach slam_system : external_slam_systems
endif
endforeach
if get_option('tracking').enabled() or get_option('tracking').auto()
build_tracking = opencv.found()
endif
if get_option('tracing')
build_tracing = percetto.found()
endif
# TODO: make these behave well when not present
x11 = dependency('x11', required: get_option('xlib'))
x11_xcb = dependency('x11-xcb', required: get_option('xlib'))