meson.build 3.66 KB
Newer Older
Zeeshan Ali's avatar
Zeeshan Ali committed
1
project('geoclue', 'c', version: '2.5.2', meson_version : '>= 0.47.2')
Zeeshan Ali's avatar
Zeeshan Ali committed
2 3 4 5 6 7 8 9 10 11

gclue_version = meson.project_version()
ver_arr = gclue_version.split('.')

gclue_major_version = ver_arr[0]
gclue_minor_version = ver_arr[1]
gclue_micro_version = ver_arr[2]

gclue_api_version='2.0'

12 13 14 15 16 17 18 19 20
datadir = join_paths(get_option('prefix'), get_option('datadir'))
includedir = join_paths(get_option('prefix'), get_option('includedir'))
libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
localedir = join_paths(datadir, 'locale')

header_dir = 'libgeoclue-' + gclue_api_version
include_subdir = join_paths(includedir, header_dir)

Zeeshan Ali's avatar
Zeeshan Ali committed
21 22 23 24 25 26 27
conf = configuration_data()
conf.set_quoted('VERSION', gclue_version)
conf.set_quoted('PACKAGE_VERSION', gclue_version)
conf.set_quoted('PACKAGE_NAME', 'geoclue')
conf.set_quoted('GETTEXT_PACKAGE', 'geoclue')
conf.set_quoted('PACKAGE_TARNAME', 'geoclue')
conf.set_quoted('PACKAGE_STRING', 'geoclue ' + gclue_version)
28 29
conf.set_quoted('PACKAGE_URL', 'https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home')
conf.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/geoclue/geoclue/issues/new')
Zeeshan Ali's avatar
Zeeshan Ali committed
30
conf.set_quoted('TEST_SRCDIR', meson.source_root() + '/data/')
31 32
conf.set_quoted('LOCALEDIR', localedir)
conf.set_quoted('SYSCONFDIR', sysconfdir)
33 34 35 36
conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source'))
conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source'))
conf.set10('GCLUE_USE_MODEM_GPS_SOURCE', get_option('modem-gps-source'))
conf.set10('GCLUE_USE_NMEA_SOURCE', get_option('nmea-source'))
Zeeshan Ali's avatar
Zeeshan Ali committed
37 38 39 40 41 42 43

configure_file(output: 'config.h', configuration : conf)
configinc = include_directories('.')

gnome = import('gnome')
cc = meson.get_compiler('c')

44 45 46
base_deps = [ dependency('glib-2.0', version: '>= 2.44.0'),
              dependency('gio-2.0', version: '>= 2.44.0'),
              dependency('gio-unix-2.0', version: '>= 2.44.0') ]
Zeeshan Ali's avatar
Zeeshan Ali committed
47 48 49 50 51 52
libm = cc.find_library('m', required: false)
if libm.found()
    base_deps += [ libm ]
endif

subdir('public-api')
53
subdir('interface')
Zeeshan Ali's avatar
Zeeshan Ali committed
54 55 56
if get_option('enable-backend')
    subdir('src')
endif
57
if get_option('libgeoclue')
Zeeshan Ali's avatar
Zeeshan Ali committed
58 59 60 61 62 63
    subdir('libgeoclue')
endif
subdir('data')
subdir('demo')
subdir('po')

64 65 66 67 68 69 70 71 72
# FIXME: The D-Bus docs should not need libgeoclue but after a few hours of
# banging my head agaist gtk-doc+meson and asking on IRC, I failed to find a
# way to tell gtk-doc to link to the uninstalled public-api static library. A
# non-working solution is in 'wip/fix-srv-docs' branch.
#
# If you look into this issue, you might also want to see how we can fix the
# dependency issue that stops the user to run `ninja -C build geoclue-doc`
# before `ninja -C build`.
if get_option('gtk-doc') and get_option('libgeoclue')
Zeeshan Ali's avatar
Zeeshan Ali committed
73 74
  subdir('docs')
endif
75

76 77
systemd_unit_dir = 'N/A'

78 79
# FIXME: Remove this once meson does it itself: https://github.com/mesonbuild/meson/issues/757
summary = '''
80
        Geoclue @0@
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
        =================

        prefix:                   @1@
        c compiler:               @2@
        Systemd system unit dir:  @3@

        Backend:                  @4@
        Convenience library:      @5@
        Introspection:            @6@
        3G source:                @7@
        CDMA source:              @8@
        Modem GPS source:         @9@
        Network NMEA source:      @10@
'''.format(gclue_version,
           get_option('prefix'),
           cc.get_id(),
           systemd_unit_dir,
           get_option('enable-backend'),
           get_option('libgeoclue'),
           get_option('introspection'),
           get_option('3g-source'),
           get_option('cdma-source'),
           get_option('modem-gps-source'),
           get_option('nmea-source'))
message(summary)