meson.build 4.53 KB
Newer Older
1
project('shotwell', ['vala', 'c'],
Jens Georg's avatar
Jens Georg committed
2
        version : '0.31.0',
3
        meson_version : '>= 0.43.0',
4
        default_options : ['buildtype=debugoptimized'])
Jens Georg's avatar
Jens Georg committed
5 6 7 8 9

gnome = import('gnome')
i18n = import('i18n')

conf = configuration_data()
10 11 12 13 14 15
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name().to_lower())
conf.set_quoted('_VERSION', meson.project_version())
conf.set_quoted('_PREFIX', get_option('prefix'))
conf.set_quoted('_LANG_SUPPORT_DIR', join_paths(get_option('prefix'), get_option('localedir')))
conf.set_quoted('_LIBEXECDIR', join_paths(get_option('prefix'), get_option('libexecdir')))
conf.set_quoted('_LIB', join_paths(get_option('prefix'), get_option('libdir')))
Jens Georg's avatar
Jens Georg committed
16
configure_file(output : 'config.h', configuration: conf)
17

Jens Georg's avatar
Jens Georg committed
18 19 20 21
config_incdir = include_directories('.')
vapi_incdir = include_directories('vapi')
shotwell_plugin_dir = join_paths(get_option('libdir'), 'shotwell', 'plugins', 'builtin')

22
add_global_arguments(['-DHAVE_CONFIG_H=1'],
23
                     ['-include'], ['config.h'],
24
                     language : 'c')
Jens Georg's avatar
Jens Georg committed
25 26 27 28 29 30 31 32 33
add_global_arguments(
    [
        '--target-glib=2.40',
        '--vapidir=@0@'.format(join_paths(meson.current_source_dir(), 'vapi')),
        '--enable-checking',
        '--enable-experimental',
    ],
    language : 'vala'
)
34

35 36 37 38 39 40 41 42 43
if get_option('fatal_warnings')
    add_global_arguments(
        [
            '--fatal-warnings'
        ],
        language : 'vala'
    )
endif

44 45
version_h = vcs_tag(command: ['git', 'rev-parse', 'HEAD'], input: 'version.h.in', output: 'version.h', fallback: '')
version = declare_dependency(sources : version_h, include_directories : include_directories('.'))
Jens Georg's avatar
Jens Georg committed
46

47
gtk = dependency('gtk+-3.0', version : '>= 3.22')
Jens Georg's avatar
Jens Georg committed
48 49 50 51 52 53 54 55
gio = dependency('gio-2.0', version: '>= 2.40')
gmodule = dependency('gmodule-2.0', version: '>= 2.40')
gio_unix = dependency('gio-unix-2.0', version: '>= 2.40')
gee = dependency('gee-0.8', version: '>= 0.8.5')
webkit = dependency('webkit2gtk-4.0', version: '>= 2.4')
soup = dependency('libsoup-2.4')
json_glib = dependency('json-glib-1.0')
xml = dependency('libxml-2.0')
56
gdk = dependency('gdk-3.0', version : '>= 3.22')
Jens Georg's avatar
Jens Georg committed
57 58 59 60 61
gdk_pixbuf = dependency('gdk-pixbuf-2.0')
sqlite = dependency('sqlite3', version : '>= 3.5.9')
gstreamer = dependency('gstreamer-1.0', version : '>= 1.0')
gstreamer_pbu = dependency('gstreamer-pbutils-1.0', version : '>= 1.0')
gphoto2 = dependency('libgphoto2', version : '>= 2.5.0')
Jens Georg's avatar
Jens Georg committed
62
gudev = dependency('gudev-1.0', version : '>= 145', required: false)
Jens Georg's avatar
Jens Georg committed
63
gexiv2 = dependency('gexiv2', version: '>= 0.11.0')
Jens Georg's avatar
Jens Georg committed
64 65
libraw = dependency('libraw', version : '>= 0.13.2')
libexif = dependency('libexif', version : '>= 0.6.16')
66
unity = dependency('unity', required : false)
Jens Georg's avatar
Jens Georg committed
67
champlain = dependency('champlain-0.12', version: '>= 0.12.16')
68 69 70 71
champlain_gtk = dependency('champlain-gtk-0.12')
clutter = dependency('clutter-1.0')
clutter_gtk = dependency('clutter-gtk-1.0')
 
Jens Georg's avatar
Jens Georg committed
72 73 74
webpdemux = dependency('libwebpdemux')
webp = dependency('libwebp')

75
unity_available = false
76
if unity.found() and get_option('unity-support')
77
  unity_available = true
78 79 80 81 82 83 84
  add_global_arguments(['--define=UNITY_SUPPORT'], language : 'vala')
endif

foreach publisher : get_option('publishers').split(',')
  add_global_arguments(['--define=HAVE_@0@'.format(publisher.to_upper())],
                       language : 'vala')
endforeach
Jens Georg's avatar
Jens Georg committed
85

86 87 88 89 90 91 92 93 94 95
foreach trace : get_option('trace').split(',')
  add_global_arguments(['--define=TRACE_@0@'.format(trace.to_upper().underscorify())],
                       language : 'vala')
endforeach

foreach measure : get_option('measure').split(',')
  add_global_arguments(['--define=MEASURE_@0@'.format(trace.to_upper().underscorify())],
                       language : 'vala')
endforeach

96
if not get_option('dupe-detection')
Jens Georg's avatar
Jens Georg committed
97 98 99 100 101
  add_global_arguments(['--define=NO_DUPE_DETECTION'], language : 'vala')
endif

if get_option('udev') and gudev.found()
  add_global_arguments(['--define=HAVE_UDEV'], language : 'vala')
102 103
endif

104
if get_option('face-detection')
105
  add_global_arguments(['--define=ENABLE_FACES'], language : 'vala')
106 107 108 109 110

  if get_option('face_detection_helper_bus') == 'private'
      add_global_arguments(['--define=FACEDETECT_BUS_PRIVATE'], language : 'vala')
  endif

NMA's avatar
NMA committed
111 112 113
  if get_option('face-detection-helper')
      subproject('shotwell-facedetect')
  endif
114 115
endif

Jens Georg's avatar
Jens Georg committed
116 117 118 119 120 121 122 123 124
json_glib = dependency('json-glib-1.0')
gdata = dependency('libgdata')
gcr = dependency('gcr-3')
gcr_ui = dependency('gcr-ui-3')
cairo = dependency('cairo')

valac = meson.get_compiler('vala')
posix = valac.find_library('posix')

Jens Georg's avatar
Jens Georg committed
125
subdir('data')
Jens Georg's avatar
Jens Georg committed
126 127 128 129 130
subdir('src')
subdir('plugins')
subdir('po')
subdir('help')
subdir('thumbnailer')
131
subdir('test')
132 133

meson.add_install_script('build-aux/meson/postinstall.py')