adg: install adg-cairo-fallback.h
[adg.git] / meson.build
blob173f3968d0f4b7b8c031316e27b8861b4a0548ab
1 project('adg', 'c',
2     meson_version: '>=0.56.0',
3     version:       '0.9.3',
4     license:       'LGPL-2.1-or-later'
7 metadata = {
8     'api':      '1.0',
9     'homepage': 'http://adg.entidi.com/',
10     'tracker':  'https://track.entidi.com/project/view/2/',
14 # How to handle LT versions (current:revision:age):
15 # - If the library source code has changed at all since the last
16 #   update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
17 # - If any interfaces have been added, removed, or changed since the
18 #   last update, increment current, and set revision to 0.
19 # - If any interfaces have been added since the last public release,
20 #   then increment age.
21 # - If any interfaces have been removed or changed since the last
22 #   public release, then set age to 0.
23 cpml_current  = 4
24 cpml_revision = 2
25 cpml_age      = 0
26 adg_current  = 8
27 adg_revision = 1
28 adg_age      = 1
31 cc         = meson.get_compiler('c')
32 gnome      = import('gnome')
33 i18n       = import('i18n')
34 pkgconfig  = import('pkgconfig')
35 pkgdir     = meson.project_name() + '-' + metadata['api']
36 prefix     = get_option('prefix')
37 datadir    = join_paths(prefix, get_option('datadir'))
38 pkgdatadir = join_paths(datadir, pkgdir)
39 localedir  = join_paths(prefix, get_option('localedir'))
40 includedir = join_paths(prefix, get_option('includedir'), pkgdir)
43 m_dep = cc.find_library('m', required: false)
45 # G_ADD_PRIVATE macro required
46 gobject_dep = dependency('gobject-2.0', version: '>=2.38.0')
48 # cairo_scaled_font_text_to_glyphs() API required
49 cairo_dep = dependency('cairo', version: '>=1.7.4')
51 # Any release
52 cairogobject_dep = dependency('cairo-gobject')
54 # Cairo support in Pango required
55 pangocairo_dep = dependency('pangocairo', version: '>=1.10.0',
56                             required: get_option('pango'))
58 # Lookup which GTK package to use
59 gtk = get_option('gtk')
60 if gtk == 'no'
61     gtk_dep = []
62 else
63     if gtk != 'gtk2'
64         # First stable release
65         gtk_dep = dependency('gtk+-3.0', version: '>= 3.0.0',
66                              required: gtk == 'gtk3')
67     endif
68     use_gtk2 = gtk == 'gtk2' or not gtk_dep.found()
69     if use_gtk2
70         # gtk_widget_get_allocation() API required
71         gtk_dep = dependency('gtk+-2.0', version: '>=2.18.0')
72     endif
73 endif
75 # Both "check" and "yes" mean gladeui autodetection,
76 # but "yes" will fail if gladeui is not found
77 catalogdir = get_option('catalogdir')
78 if catalogdir == 'yes' or catalogdir == 'check'
79     glade_dep = dependency('gladeui-2.0', required: false)
80     if not glade_dep.found()
81         glade_dep = dependency('gladeui-1.0', required: catalogdir == 'yes')
82     endif
83     if glade_dep.found()
84         catalogdir = glade_dep.get_variable(pkgconfig: 'catalogdir')
85     else
86         catalogdir = ''
87     endif
88 elif catalogdir == 'no'
89     # Both 'no' and '' mean "Do not install catalogs"
90     catalogdir = ''
91 endif
93 # Support for introspection annotations required
94 gtkdoc_dep = dependency('gtk-doc', required: get_option('gtk-doc'),
95                         version: '>=1.12')
97 gtkdocdir = get_option('gtkdocdir')
98 if gtkdocdir == ''
99     gtkdocdir = join_paths(get_option('prefix'), get_option('datadir'), 'gtk-doc', 'html')
100 endif
102 # First stable release
103 introspection_dep = dependency('gobject-introspection-1.0', version: '>=1.0.0',
104                                required: get_option('introspection'))
106 # Check if GLib supports the testing framework
107 testing = dependency('glib-2.0', version: '>=2.16.0',
108                      required: get_option('tests'))
111 subdir('src')
112 subdir('po')
113 if gtk_dep.found()
114     subdir('demo')
115 endif
116 if gtkdoc_dep.found()
117     subdir('docs/cpml')
118     subdir('docs/adg')
119 endif
122 summary({
123     'Compiler':
124         cc.get_id(),
125     'CPML library to use':
126         'internal (cpml-@0@ @1@)'.format(metadata['api'], meson.project_version()),
127     'Use pango for text':
128         pangocairo_dep.found() ?
129             'yes (@0@ @1@)'.format(pangocairo_dep.name(), pangocairo_dep.version()) :
130             'no (use cairo toy API)',
131     'GTK support':
132         gtk_dep.found() ?
133             'yes (@0@ @1@)'.format(gtk_dep.name(), gtk_dep.version()) :
134             'no',
135     'Install glade catalogs':
136         catalogdir == '' ? 'no' : 'yes, install into @0@'.format(catalogdir),
137     'Build API reference':
138         gtkdoc_dep.found() ?
139             'yes (@0@ @1@), install into @2@'.
140                 format(gtkdoc_dep.name(), gtkdoc_dep.version(), gtkdocdir) :
141             'no',
142     'GObject instrospection':
143         introspection_dep.found() ?
144             'yes (@0@ @1@)'.format(introspection_dep.name(), introspection_dep.version()) :
145             'no',
146     'Test framework support':
147         testing.found() ? 'yes' : 'no'