[tracker-miners] meson: Add tracker core as a subproject



commit 66bb62782cffc59b66f22fc3e10e9612ddd9147e
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Tue Oct 31 17:24:49 2017 +0000

    meson: Add tracker core as a subproject
    
    This allows building tracker-miners and tracker core with a single
    invocation of Meson and Ninja. It also allows apps to embed their
    own copy of Tracker just by adding tracker-miners as a subproject in
    their Meson buildsystem.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789725

 meson.build |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 36e6292..ecda78c 100644
--- a/meson.build
+++ b/meson.build
@@ -9,8 +9,22 @@ tracker_api_version = '2.0'
 
 glib_required = '2.40.0'
 
-tracker_sparql = dependency('tracker-sparql-2.0', version: '>= 1.99.0', required: true)
-tracker_miner = dependency('tracker-miner-2.0', version: '>= 1.99.0', required: true)
+tracker_sparql = dependency('tracker-sparql-2.0', version: '>= 1.99.0', required: false)
+tracker_miner = dependency('tracker-miner-2.0', version: '>= 1.99.0', required: false)
+
+if not tracker_sparql.found() or not tracker_miner.found()
+  message('Tracker libraries were not found or are too old. A local copy will be built if possible.')
+  tracker_subproject = subproject('tracker',
+    default_options: [
+       'dbus_services=@0@'.format(get_option('dbus_services')),
+       'docs=@0@'.format(get_option('docs')),
+       'systemd_user_services=@0@'.format(get_option('systemd_user_services')),
+    ])
+
+  tracker_sparql = tracker_subproject.get_variable('tracker_sparql_dep')
+  tracker_miner = tracker_subproject.get_variable('tracker_miner_dep')
+endif
+
 avcodec = dependency('libavcodec', version: '>= 0.8.4', required: false)
 avformat = dependency('libavformat', version: '>= 0.8.4', required: false)
 avutil = dependency('libavutil', version: '>= 0.8.4', required: false)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]