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



commit 4b6d1ec7323ceeda3b481f4a155857c222d1ca59
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 |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 9b4989b..aa5c286 100644
--- a/meson.build
+++ b/meson.build
@@ -9,8 +9,19 @@ 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')
+
+  tracker_sparql = tracker_subproject.get_variable('tracker_sparql_dep')
+  tracker_miner = tracker_subproject.get_variable('tracker_miner_dep')
+else
+  tracker_subproject = false
+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]