summaryrefslogtreecommitdiff
path: root/ext/opencv/meson.build
blob: 01bb64019f8c578828751019008b1ecded873604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
opencv_sources = [
  'gstcvdilate.cpp',
  'gstcvdilateerode.cpp',
  'gstcvequalizehist.cpp',
  'gstcverode.cpp',
  'gstcvlaplace.cpp',
  'gstcvsmooth.cpp',
  'gstcvsobel.cpp',
  'gstdisparity.cpp',
  'gstedgedetect.cpp',
  'gstfaceblur.cpp',
  'gstfacedetect.cpp',
  'gstgrabcut.cpp',
  'gsthanddetect.cpp',
  'gstmotioncells.cpp',
  'gstopencv.cpp',
  'gstretinex.cpp',
  'gstsegmentation.cpp',
  'gstskindetect.cpp',
  'gsttemplatematch.cpp',
  'gsttextoverlay.cpp',
  'MotionCells.cpp',
  'motioncells_wrapper.cpp'
]

opencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"']
runcmd = run_command('pkg-config', '--variable=prefix', 'opencv')
if runcmd.returncode() == 0
  opencv_cargs += '-DOPENCV_PREFIX="' + runcmd.stdout().strip() + '"'
endif

r = run_command('test', '-d', '/usr/share/opencv')
if r.returncode() == 0
  opencv_cargs += '-DOPENCV_PATH_NAME="opencv"'
else
  opencv_cargs += '-DOPENCV_PATH_NAME="OpenCv"'
endif

opencv_dep = dependency('opencv', version : '>= 2.3.0')
if opencv_dep.found()
  gstopencv = library('gstopencv',
    opencv_sources,
    cpp_args : gst_plugins_bad_args + opencv_cargs + [ '-DGST_USE_UNSTABLE_API' ],
    link_args : noseh_link_args,
    include_directories : [configinc],
    dependencies : [gstbase_dep, gstvideo_dep, opencv_dep, gstopencv_dep],
    install : true,
    install_dir : plugins_install_dir,
  )
endif