summaryrefslogtreecommitdiff
path: root/subprojects/shotwell-facedetect/meson.build
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-28 21:35:52 +0200
commitb86540b743f1a87a163ffb811c8fe22a01fefa38 (patch)
treeb47cb3bb83c2377234226fb3987ab3320a987dd9 /subprojects/shotwell-facedetect/meson.build
parentac6e0b731b9f0b2efd392e3309a5c07e2a66adad (diff)
parente905d8e16eec152d19797937f13ba3cf4b8f8aca (diff)
Merge branch 'release/debian/0.32.1-1'debian/0.32.1-1
Diffstat (limited to 'subprojects/shotwell-facedetect/meson.build')
-rw-r--r--subprojects/shotwell-facedetect/meson.build62
1 files changed, 62 insertions, 0 deletions
diff --git a/subprojects/shotwell-facedetect/meson.build b/subprojects/shotwell-facedetect/meson.build
new file mode 100644
index 0000000..70570e4
--- /dev/null
+++ b/subprojects/shotwell-facedetect/meson.build
@@ -0,0 +1,62 @@
+project('shotwell-facedetect', ['c', 'cpp'], default_options : ['cpp_std=c++17'])
+gnome = import('gnome')
+facedetect_dep = dependency('opencv4', version : ['>= 4.0.0'], required : false)
+if not facedetect_dep.found()
+ facedetect_dep = dependency('opencv', version : ['>= 3.4.0'], required : true)
+endif
+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('haarcascade_frontalface_alt.xml',
+ install_dir : join_paths(get_option('datadir'), 'shotwell', 'facedetect'))
+install_data('haarcascade_profileface.xml',
+ install_dir : join_paths(get_option('datadir'), 'shotwell', 'facedetect'))
+install_data(
+ 'openface.nn4.small2.v1.t7',
+ install_dir: join_paths(get_option('datadir'), 'shotwell', 'facedetect')
+)
+
+install_data('deploy.prototxt', install_dir: join_paths(get_option('datadir'), 'shotwell', 'facedetect'))
+
+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')
+ )