Seg fault handler
[geeqie.git] / meson.build
1 # This file is a part of Geeqie project (https://www.geeqie.org/).
2 # Copyright (C) 2008 - 2022 The Geeqie Team
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # Meson default directories used in this project:
15 # prefix - /usr/local
16 # bindir - bin
17 # datadir - share
18
19 # Meson core options:
20 # buildtype
21 # debug
22
23 # Project expanded default directories:
24 # prefix        /usr/local/
25 # bindir        /usr/local/bin                          geeqie executable
26 # gq_bindir     /usr/local/lib/geeqie               *   plugins scripts
27 # datadir       /usr/local/share/
28 #               /usr/local/share/applications           geeqie.desktop
29 # [gq_]appdir   /usr/local/share/geeqie/            *   template.desktop
30 # desktopdir    /usr/local/share/geeqie/applications    plugin desktop files
31 # appdatadir    /usr/local/share/metainfo               org.geeqie.Geeqie.appdata.xml
32 # icondir       /usr/local/share/pixmaps                geeqie.png icon
33 # [gq_]helpdir  /usr/local/share/doc/geeqie         *   readme files etc.
34 # [gq_]htmldir  /usr/local/share/doc/geeqie/html    *   help files
35 # gq_localedir  /usr/locale/share/locale
36 # mandir1       /usr/local/share/man/man1               man page
37 # podir         project_root/po
38
39 # * See meson_options.txt file
40
41 project(
42     'geeqie',
43     'c',
44     'cpp',
45     version : run_command('./version.sh', check : true).stdout().strip(),
46     license : ['GPL-2.0-or-later'],
47     meson_version : '>=0.53.0',
48     default_options : ['warning_level=3', 'buildtype=debugoptimized', 'cpp_link_args=-rdynamic']
49 )
50
51 # To inhibit warnings from the generated files icons_inline.h and ui_icons.h
52 add_global_arguments('-Wno-overlength-strings', language : 'c')
53
54 # To compile originally-C files as C++
55 add_global_arguments('-fpermissive', language : 'cpp')
56 add_global_arguments('-Wno-error=deprecated-declarations', language : 'cpp')
57 add_global_arguments('-Wno-error=sign-compare', language : 'cpp')
58 add_global_arguments('-Wno-error=return-type', language : 'cpp')
59 add_global_arguments('-Wno-error=literal-suffix', language : 'cpp')
60 add_global_arguments('-Wno-error=write-strings', language : 'cpp')
61
62 # Project requirements
63 project_sources = []
64 gnome = import('gnome')
65 thread_dep = dependency('threads')
66 cc = meson.get_compiler('c')
67 i18n = import('i18n')
68 fs = import('fs')
69 configuration_inc = include_directories('.')
70
71 # External programs
72 gdk_pixbuf_csource = find_program('gdk-pixbuf-csource', required : true)
73 glib_compile_resources = find_program('glib-compile-resources', required : true)
74 glib_genmarshal = find_program('glib-genmarshal', required : true)
75
76 option = get_option('git')
77 if not option.disabled()
78     running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
79 else
80     running_from_git = false
81     summary({'git' : ['disabled - ChangeLog, ChangeLog.html, lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
82 endif
83
84 debug = get_option('debug')
85
86 # Note that main.cc sets prefix to the directory above where the executable is run from.
87 # This is to allow AppImages to be used
88
89 # These gq_* variables are paths relative to /prefix/,
90 # and are also used in defines in the source as GQ_*
91 if get_option('gq_appdir') == ''
92     gq_appdir = join_paths(get_option('datadir'), 'geeqie')
93 else
94     gq_appdir = get_option('gq_appdir')
95 endif
96
97 # This is not the same as Meson bindir
98 if get_option('gq_bindir') == ''
99     gq_bindir = 'lib/geeqie'
100 else
101     gq_bindir = get_option('gq_bindir')
102 endif
103
104 if get_option('gq_helpdir') == ''
105     gq_helpdir = join_paths(get_option('datadir'), 'doc/geeqie')
106 else
107     gq_helpdir = get_option('gq_helpdir')
108 endif
109
110 if get_option('gq_htmldir') == ''
111     gq_htmldir = join_paths(get_option('datadir'), 'doc/geeqie/html')
112 else
113     gq_htmldir = get_option('gq_htmldir')
114 endif
115
116 if get_option('gq_localedir') == ''
117     gq_localedir = join_paths(get_option('datadir'), 'locale')
118 else
119     gq_localedir = get_option('gq_localedir')
120 endif
121
122
123 # Set up the absolute directory paths used
124 prefix = get_option('prefix')
125 datadir = join_paths(prefix, get_option('datadir'))
126
127 # Installation paths are absolute
128 appdir = join_paths(prefix, gq_appdir)
129 appdatadir = join_paths(datadir, 'metainfo')
130 desktopdir = join_paths(datadir, meson.project_name(), 'applications')
131 helpdir = join_paths(prefix, gq_helpdir)
132 htmldir = join_paths(prefix, gq_htmldir)
133 icondir = join_paths(datadir, 'pixmaps')
134 mandir1 = join_paths(datadir, 'man', 'man1')
135
136 podir = join_paths(meson.source_root(), 'po')
137
138 summary({'gq_appdir': gq_appdir,
139         'gq_bindir': gq_helpdir,
140         'gq_helpdir': gq_helpdir,
141         'gq_htmldir': gq_htmldir,
142         'gq_localedir': gq_localedir,
143         }, section: 'Directories')
144
145 # Create the define constants used in the sources. Set via config.h.in
146 conf_data = configuration_data()
147 conf_data.set_quoted('VERSION', meson.project_version())
148 conf_data.set('DEBUG', debug)
149
150 gtk_dep = dependency('gtk+-3.0', version : '>=3.22', required: true)
151 glib_dep = dependency('glib-2.0', version : '>=2.52', required: true)
152
153 libarchive_dep = []
154 req_version = '>=3.4.0'
155 option = get_option('archive')
156 if not option.disabled()
157     libarchive_dep = dependency('libarchive', version : req_version, required : get_option('archive'))
158     if libarchive_dep.found()
159         conf_data.set('HAVE_ARCHIVE', 1)
160         summary({'archive' : ['archive files e.g. .zip supported:', true]}, section : 'Configuration', bool_yn : true)
161     else
162         summary({'archive' : ['libarchive ' + req_version + ' not found - archive files e.g. .zip supported::', false]}, section : 'Configuration', bool_yn : true)
163     endif
164 else
165     summary({'archive' : ['disabled - archive files e.g. .zip supported:', false]}, section : 'Configuration', bool_yn : true)
166 endif
167
168 lcms_dep = []
169 req_version = '>=2.0'
170 option = get_option('cms')
171 if not option.disabled()
172     xxd = find_program('xxd', 'xxdi.pl', required : false)
173     if xxd.found()
174         lcms_dep = dependency('lcms2', version : req_version, required : get_option('cms'))
175         if lcms_dep.found()
176             conf_data.set('HAVE_LCMS', 1)
177             conf_data.set('HAVE_LCMS2', 1)
178             summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
179         else
180             summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
181         endif
182     else
183         summary({'cms' : ['xxd or xxdi.pl not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
184     endif
185 else
186     summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)
187 endif
188
189 ddjvuapi_dep = []
190 req_version = '>=2.5.27'
191 option = get_option('djvu')
192 if not option.disabled()
193     ddjvuapi_dep = dependency('ddjvuapi', version : req_version, required : get_option('djvu'))
194     if ddjvuapi_dep.found()
195         conf_data.set('HAVE_DJVU', 1)
196         summary({'djvu' : ['djvu files supported:', true]}, section : 'Configuration', bool_yn : true)
197     else
198         summary({'djvu' : ['ddjvuapi ' + req_version + ' not found - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
199     endif
200 else
201     summary({'djvu' : ['disabled - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
202 endif
203
204 option = get_option('evince')
205 if not option.disabled()
206     evince = find_program('evince', required : false)
207     if evince.found()
208         summary({'print preview' : ['print preview supported:', true]}, section : 'Configuration', bool_yn : true)
209     else
210         summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
211     endif
212 else
213     summary({'print preview' : ['disabled - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
214 endif
215
216 # Required only for seg. fault stacktrace and backtrace debugging
217 option = get_option('execinfo')
218 if not option.disabled()
219     result = cc.check_header('execinfo.h')
220     if result
221         conf_data.set('HAVE_EXECINFO_H', 1)
222         summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Configuration', bool_yn : true)
223     else
224         summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
225     endif
226 else
227     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
228 endif
229
230 exiv2_dep = []
231 req_version = '>=0.11'
232 option = get_option('exiv2')
233 if not option.disabled()
234     exiv2_dep = dependency('exiv2', version : req_version, required : get_option('exiv2'))
235     if exiv2_dep.found()
236         conf_data.set('HAVE_EXIV2', 1)
237         summary({'exiv2' : ['image metadata processed by exiv2:', true]}, section : 'Configuration', bool_yn : true)
238     else
239         summary({'exiv2' : ['exiv2 ' + req_version + ' not found - image data not processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
240     endif
241 else
242     summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
243 endif
244
245 champlain_dep = []
246 champlain_gtk_dep = []
247 clutter_dep = []
248 clutter_gtk_dep = []
249 req_version_champlain = '>=0.12'
250 req_version_champlain_gtk = '>=0.12'
251 req_version_clutter = '>=1.0'
252 req_version_clutter_gtk = '>=1.0'
253 option = get_option('gps-map')
254 if not option.disabled()
255     champlain_dep = dependency('champlain-0.12', version : req_version_champlain, required : get_option('gps-map'))
256     champlain_gtk_dep = dependency('champlain-gtk-0.12', version : req_version_champlain_gtk, required : get_option('gps-map'))
257     if champlain_dep.found() and champlain_gtk_dep.found()
258         clutter_dep = dependency('clutter-1.0', version : req_version_clutter, required : get_option('gps-map'))
259         clutter_gtk_dep = dependency('clutter-gtk-1.0', version : req_version_clutter_gtk, required : get_option('gps-map'))
260         if clutter_dep.found() and clutter_gtk_dep.found()
261             conf_data.set('HAVE_CLUTTER', 1)
262             conf_data.set('HAVE_LIBCHAMPLAIN', 1)
263             conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 1)
264             summary({'gps-map' : ['GPS map displayed', true]}, section : 'Configuration', bool_yn : true)
265         else
266             if not clutter_dep.found()
267                 summary({'gps-map-clutter' : ['clutter-1.0 ' + req_version_clutter + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
268             endif
269             if not clutter_gtk_dep.found()
270                 summary({'gps-map-clutter-gtk' : ['clutter-gtk-1.0 ' + req_version_clutter_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
271             endif
272         endif
273     else
274         if not champlain_dep.found()
275             summary({'gps-map-champlain' : ['champlain-0.12 ' + req_version_champlain + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
276         endif
277         if not champlain_gtk_dep.found()
278             summary({'gps-map-champlain-gtk' : ['champlain-gtk-0.12 ' + req_version_champlain_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
279         endif
280     endif
281 else
282     summary({'gps-map' : ['disabled - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
283 endif
284
285 libheif_dep = []
286 req_version = '>=1.3.2'
287 option = get_option('heif')
288 if not option.disabled()
289     libheif_dep = dependency('libheif', version : req_version, required : get_option('heif'))
290     if libheif_dep.found()
291         conf_data.set('HAVE_HEIF', 1)
292         summary({'heif' : ['heif files supported:', true]}, section : 'Configuration', bool_yn : true)
293     else
294         summary({'heif' : ['libheif ' + req_version + ' not found - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
295     endif
296 else
297     summary({'heif' : ['disabled - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
298 endif
299
300 libopenjp2_dep = []
301 req_version = '>=2.3.0'
302 option = get_option('j2k')
303 if not option.disabled()
304     libopenjp2_dep = dependency('libopenjp2', version : req_version, required : get_option('j2k'))
305     if libopenjp2_dep.found()
306         conf_data.set('HAVE_J2K', 1)
307         summary({'j2k' : ['j2k files supported:', true]}, section : 'Configuration', bool_yn : true)
308     else
309         summary({'j2k' : ['libopenjp2 ' + req_version + ' not found - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
310     endif
311 else
312     summary({'j2k' : ['disabled - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
313 endif
314
315 libjpeg_dep = []
316 option = get_option('jpeg')
317 if not option.disabled()
318 libjpeg_dep = dependency('libjpeg', required : get_option('jpeg'))
319     if libjpeg_dep.found()
320         if cc.has_function('jpeg_destroy_decompress', dependencies : libjpeg_dep)
321             conf_data.set('HAVE_JPEG', 1)
322             summary({'jpeg' : ['jpeg files supported:', true]}, section : 'Configuration', bool_yn : true)
323         else
324             summary({'jpeg' : ['jpeg_destroy_decompress not found - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
325         endif
326     else
327         summary({'jpeg' : ['libjpeg: not found', false]}, section : 'Configuration', bool_yn : true)
328     endif
329 else
330     summary({'jpeg' : ['disabled - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
331 endif
332
333 libjxl_dep = []
334 req_version = '>=0.3.7'
335 option = get_option('jpegxl')
336 if not option.disabled()
337     libjxl_dep = dependency('libjxl', version : req_version, required : get_option('jpegxl'))
338     if libjxl_dep.found()
339         conf_data.set('HAVE_JPEGXL', 1)
340         summary({'jpegxl' : ['jpegxl files supported:', true]}, section : 'Configuration', bool_yn : true)
341     else
342         summary({'jpegxl' : ['libjxl ' + req_version + ' not found - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
343     endif
344 else
345     summary({'jpegxl' : ['disabled - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
346 endif
347
348 libraw_dep = []
349 req_version = '>=0.20'
350 option = get_option('libraw')
351 if not option.disabled()
352     libraw_dep = dependency('libraw', version : req_version, required : get_option('libraw'))
353     if libraw_dep.found()
354         conf_data.set('HAVE_RAW', 1)
355         summary({'libraw' : ['.cr3 files supported:', true]}, section : 'Configuration', bool_yn : true)
356     else
357         summary({'libraw' : ['libraw ' + req_version + ' not found - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
358     endif
359 else
360     summary({'libraw' : ['disabled - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
361 endif
362
363 lua_dep = []
364 req_version = '>=5.3'
365 option = get_option('lua')
366 if not option.disabled()
367     foreach name : ['lua', 'lua5.3', 'lua-5.3', 'lua53']
368         lua_dep = dependency(name, version: req_version, required: get_option('lua'))
369         if lua_dep.found()
370             break
371         endif
372     endforeach
373     if lua_dep.found()
374         conf_data.set('HAVE_LUA', 1)
375         summary({'lua' : ['lua supported:', true]}, section : 'Configuration', bool_yn : true)
376     else
377         summary({'lua' : ['lua ' + req_version + ' not found - lua supported:', false]}, section : 'Configuration', bool_yn : true)
378     endif
379 else
380     summary({'lua' : ['disabled - lua supported:', false]}, section : 'Configuration', bool_yn : true)
381 endif
382
383 option = get_option('pandoc')
384 if not option.disabled()
385     pandoc = find_program('pandoc', required : false)
386     if pandoc.found()
387         readme_html = custom_target(
388             'README.html',
389             input: 'README.md',
390             output: 'README.html',
391             command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
392             install: true,
393             install_dir: helpdir)
394
395         summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
396     else
397         summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
398     endif
399     install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', install_dir : helpdir)
400 else
401     summary({'pandoc' : ['disabled - README.html created:', false]}, section : 'Documentation', bool_yn : true)
402 endif
403
404 poppler_glib_dep = []
405 req_version = '>=0.62'
406 option = get_option('pdf')
407 if not option.disabled()
408     poppler_glib_dep = dependency('poppler-glib', version : req_version, required : get_option('pdf'))
409     if poppler_glib_dep.found()
410         conf_data.set('HAVE_PDF', 1)
411         summary({'pdf'  : ['pdf files supported:', true]}, section : 'Configuration', bool_yn : true)
412     else
413         summary({'pdf' : ['poppler-glib ' + req_version + ' not found - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
414     endif
415 else
416     summary({'pdf' : ['disabled - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
417 endif
418
419 gspell_dep = []
420 req_version = '>=1.6'
421 option = get_option('spell')
422 if not option.disabled()
423     gspell_dep = dependency('gspell-1', version : req_version, required: get_option('spell'))
424     if gspell_dep.found()
425         conf_data.set('HAVE_SPELL', 1)
426         summary({'spell' : ['spelling checks enabled', true]}, section : 'Configuration', bool_yn : true)
427     else
428         summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
429     endif
430 else
431     summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
432 endif
433
434 tiff_dep = []
435 option = get_option('tiff')
436 if not option.disabled()
437     tiff_dep = dependency('libtiff-4', required: get_option('tiff'))
438     if tiff_dep.found()
439         if cc.has_function('TIFFClientOpen', dependencies : tiff_dep)
440             conf_data.set('HAVE_TIFF', 1)
441             summary({'tiff' : ['tiff files supported:', true]}, section : 'Configuration', bool_yn : true)
442         else
443             summary({'tiff' : ['TIFFClientOpen not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
444         endif
445     else
446         summary({'tiff' : ['libtiff not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
447     endif
448 else
449     summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
450 endif
451
452 libffmpegthumbnailer_dep = []
453 req_version = '>=2.1.0'
454 option = get_option('videothumbnailer')
455 if not option.disabled()
456     libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer',
457         version : req_version,
458         required : get_option('videothumbnailer'))
459
460     if libffmpegthumbnailer_dep.found()
461         conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1)
462         summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
463
464         result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
465         if result
466             conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
467         endif
468         summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
469
470         result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
471         if result
472             conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
473         endif
474         summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
475
476         result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
477         if result
478             conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
479         endif
480         summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
481     else
482         summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
483     endif
484 else
485     summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
486 endif
487
488 libwebp_dep = []
489 req_version = '>=0.6.1'
490 option = get_option('webp')
491 if not option.disabled()
492     libwebp_dep = dependency('libwebp', version : req_version, required : get_option('webp'))
493     if libwebp_dep.found()
494         conf_data.set('HAVE_WEBP', 1)
495         summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
496     else
497         summary({'webp' : ['libwebp ' + req_version + ' not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
498     endif
499 else
500     summary({'webp' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
501 endif
502
503 # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
504 code = '''#include <langinfo.h>
505 #include<stdio.h>
506 int main (int argc, char ** argv) {
507     char *c;
508     c =  nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
509     return 0;
510 }'''
511 if cc.links(code, name : 'nl_langinfo and _NL_TIME_FIRST_WEEKDAY')
512     conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 1)
513     summary({'nl_langinfo' : ['first weekday depends on locale:', true]}, section : 'Documentation', bool_yn : true)
514 else
515     summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true)
516 endif
517
518 conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
519 conf_data.set_quoted('GQ_APPDIR', gq_appdir)
520 conf_data.set_quoted('GQ_BINDIR', gq_bindir)
521 conf_data.set_quoted('GQ_HELPDIR', gq_helpdir)
522 conf_data.set_quoted('GQ_HTMLDIR', gq_htmldir)
523 conf_data.set_quoted('GQ_LOCALEDIR', gq_localedir)
524
525 conf_data.set_quoted('PACKAGE', meson.project_name())
526 conf_data.set_quoted('PACKAGE_NAME', meson.project_name())
527 conf_data.set_quoted('PACKAGE_STRING', meson.project_version())
528 conf_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
529 conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
530 conf_data.set_quoted('VERSION', meson.project_version())
531
532 configure_file(input : 'config.h.in',
533                output : 'config.h',
534                encoding : 'UTF-8',
535                configuration : conf_data)
536
537 # Process subdirs before the sources
538 subdir('po')
539 subdir('plugins')
540
541 # Generate the executable
542 subdir('src')
543
544 # Generate the help files
545 subdir('doc')
546
547 # Install other project files
548 if running_from_git
549     cmd = [find_program('gen_changelog.sh'), meson.current_source_dir(), meson.current_build_dir()]
550     custom_target(
551         'ChangeLog',
552         input: 'ChangeLog.gqview',
553         output: ['ChangeLog', 'ChangeLog.html'],
554         command: cmd,
555         install: true,
556         install_dir: helpdir)
557     meson.add_dist_script(cmd)
558     summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', true]}, section : 'Documentation', bool_yn : true)
559 elif fs.exists('ChangeLog.html')
560     install_data('ChangeLog', 'ChangeLog.html', install_dir: helpdir)
561     summary({'ChangeLog' : ['ChangeLog, ChangeLog.html installed from dist:', true]}, section : 'Documentation', bool_yn : true)
562 endif
563
564 install_data('geeqie.png', install_dir : icondir)
565 install_data('geeqie.1', install_dir : mandir1)
566
567 i18n.merge_file(
568     input : 'geeqie.desktop.in',
569     output : 'geeqie.desktop',
570     type : 'desktop',
571     po_dir : podir,
572     install : true,
573     install_dir : join_paths(datadir, 'applications'))
574
575 i18n.merge_file(
576     input : 'org.geeqie.Geeqie.appdata.xml.in',
577     output : 'org.geeqie.Geeqie.appdata.xml',
578     type : 'xml',
579     po_dir : podir,
580     install : true,
581     install_dir : appdatadir)
582
583 configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data)