build: show compiler in the summary
[adg.git] / meson.build
blobbd5d91b14f301ef833c3413822c392acbb1ee94c
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 # First stable release
98 introspection_dep = dependency('gobject-introspection-1.0', version: '>=1.0.0',
99                                required: get_option('introspection'))
101 # Check if GLib supports the testing framework
102 testing = dependency('glib-2.0', version: '>=2.16.0',
103                      required: get_option('tests'))
106 subdir('src')
107 subdir('po')
108 if gtk_dep.found()
109     subdir('demo')
110 endif
111 if gtkdoc_dep.found()
112     subdir('docs/cpml')
113     subdir('docs/adg')
114 endif
117 summary({
118     'Compiler':
119         cc.get_id(),
120     'CPML library to use':
121         'internal (cpml-@0@ @1@)'.format(metadata['api'], meson.project_version()),
122     'Use pango for text':
123         pangocairo_dep.found() ?
124             'yes (@0@ @1@)'.format(pangocairo_dep.name(), pangocairo_dep.version()) :
125             'no (use cairo toy API)',
126     'GTK support':
127         gtk_dep.found() ?
128             'yes (@0@ @1@)'.format(gtk_dep.name(), gtk_dep.version()) :
129             'no',
130     'Install glade catalogs':
131         catalogdir == '' ? 'no' : 'yes (@0@)'.format(catalogdir),
132     'Build API reference':
133         gtkdoc_dep.found() ?
134             'yes (@0@ @1@)'.format(gtkdoc_dep.name(), gtkdoc_dep.version()) :
135             'no',
136     'GObject instrospection':
137         introspection_dep.found() ?
138             'yes (@0@ @1@)'.format(introspection_dep.name(), introspection_dep.version()) :
139             'no',
140     'Test framework support':
141         testing.found() ? 'yes' : 'no'