meson.build 1.79 KB
Newer Older
1
project('shotwell-facedetect', ['c', 'cpp'], default_options : ['cpp_std=c++14'])
NMA's avatar
NMA committed
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 51
gnome = import('gnome')
facedetect_dep = dependency('opencv', version : ['>= 2.3.0'], required : true)
cpp = meson.get_compiler('cpp')
has_dnn = cpp.has_header('opencv2/dnn.hpp', dependencies: facedetect_dep)
if has_dnn
  dnn_define = declare_dependency(compile_args: '-DHAS_OPENCV_DNN')
else
  dnn_define = []
endif

libexecdir = join_paths(get_option('libexecdir'), 'shotwell')

gio = dependency('gio-2.0', version: '>= 2.40')
gio_unix = dependency('gio-unix-2.0', required : true)
gdbus_src = gnome.gdbus_codegen('dbus-interface',
  sources: 'org.gnome.ShotwellFaces1.xml',
  interface_prefix : 'org.gnome.')

con = configuration_data()
con.set('libexecdir', join_paths(get_option('prefix'), libexecdir))

if meson.is_subproject()
    config_incdir = include_directories('../..')
else
    config_incdir = include_directories('.')
    configure_file(
        input: 'org.gnome.Shotwell.Faces1.desktop.in',
        output: 'org.gnome.Shotwell.Faces1.desktop',
        configuration: con,
        install: true,
        install_dir : join_paths(get_option('datadir'), 'applications')
    )
endif

executable('shotwell-facedetect',
           'shotwell-facedetect.cpp', 'facedetect-opencv.cpp', gdbus_src,
           dependencies : [facedetect_dep, gio, gio_unix, dnn_define],
           install : true,
           include_directories: config_incdir,
           install_dir : libexecdir)
install_data('facedetect-haarcascade.xml',
              install_dir : join_paths(get_option('datadir'), 'shotwell'))

configure_file(
    input : 'org.gnome.Shotwell.Faces1.service.in',
    output : 'org.gnome.Shotwell.Faces1.service',
    configuration: con,
    install: true,
    install_dir : join_paths(get_option('datadir'), 'dbus-1', 'services')
    )