Extended stack trace
[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 # Extended stack trace using backward-app
72 option = get_option('devel')
73 if option.enabled()
74     if cc.has_link_argument('-ldwarf')
75         add_project_link_arguments('-ldwarf', language: 'cpp')
76     endif
77 endif
78
79 # External programs
80 gdk_pixbuf_csource = find_program('gdk-pixbuf-csource', required : true)
81 glib_compile_resources = find_program('glib-compile-resources', required : true)
82 glib_genmarshal = find_program('glib-genmarshal', required : true)
83
84 option = get_option('git')
85 if not option.disabled()
86     running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
87 else
88     running_from_git = false
89     summary({'git' : ['disabled - ChangeLog, ChangeLog.html, lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
90 endif
91
92 debug = get_option('debug')
93
94 # Note that main.cc sets prefix to the directory above where the executable is run from.
95 # This is to allow AppImages to be used
96
97 # These gq_* variables are paths relative to /prefix/,
98 # and are also used in defines in the source as GQ_*
99 if get_option('gq_appdir') == ''
100     gq_appdir = join_paths(get_option('datadir'), 'geeqie')
101 else
102     gq_appdir = get_option('gq_appdir')
103 endif
104
105 # This is not the same as Meson bindir
106 if get_option('gq_bindir') == ''
107     gq_bindir = 'lib/geeqie'
108 else
109     gq_bindir = get_option('gq_bindir')
110 endif
111
112 if get_option('gq_helpdir') == ''
113     gq_helpdir = join_paths(get_option('datadir'), 'doc/geeqie')
114 else
115     gq_helpdir = get_option('gq_helpdir')
116 endif
117
118 if get_option('gq_htmldir') == ''
119     gq_htmldir = join_paths(get_option('datadir'), 'doc/geeqie/html')
120 else
121     gq_htmldir = get_option('gq_htmldir')
122 endif
123
124 if get_option('gq_localedir') == ''
125     gq_localedir = join_paths(get_option('datadir'), 'locale')
126 else
127     gq_localedir = get_option('gq_localedir')
128 endif
129
130
131 # Set up the absolute directory paths used
132 prefix = get_option('prefix')
133 datadir = join_paths(prefix, get_option('datadir'))
134
135 # Installation paths are absolute
136 appdir = join_paths(prefix, gq_appdir)
137 appdatadir = join_paths(datadir, 'metainfo')
138 desktopdir = join_paths(datadir, meson.project_name(), 'applications')
139 helpdir = join_paths(prefix, gq_helpdir)
140 htmldir = join_paths(prefix, gq_htmldir)
141 icondir = join_paths(datadir, 'pixmaps')
142 mandir1 = join_paths(datadir, 'man', 'man1')
143
144 podir = join_paths(meson.source_root(), 'po')
145
146 summary({'gq_appdir': gq_appdir,
147         'gq_bindir': gq_helpdir,
148         'gq_helpdir': gq_helpdir,
149         'gq_htmldir': gq_htmldir,
150         'gq_localedir': gq_localedir,
151         }, section: 'Directories')
152
153 # Create the define constants used in the sources. Set via config.h.in
154 conf_data = configuration_data()
155 conf_data.set_quoted('VERSION', meson.project_version())
156 conf_data.set('DEBUG', debug)
157
158 gtk_dep = dependency('gtk+-3.0', version : '>=3.22', required: true)
159 glib_dep = dependency('glib-2.0', version : '>=2.52', required: true)
160
161 # Required only when backward-cpp is used
162 libdw_dep = []
163 libunwind_dep = []
164 option = get_option('devel')
165 if option.enabled()
166     libdw_dep = dependency('libdw', required : true)
167     if libdw_dep.found()
168         libunwind_dep = dependency('libunwind', required : true)
169         if libunwind_dep.found()
170             conf_data.set('HAVE_DEVELOPER', 1)
171             summary({'developer mode' : ['extended stacktrace:', true]}, section : 'Debugging', bool_yn : true)
172         else
173             summary({'developer mode' : ['libunwind not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
174         endif
175     else
176         summary({'developer mode' : ['libdw not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
177     endif
178 else
179     summary({'developer mode' : ['extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
180 endif
181
182 # Required only for seg. fault stacktrace and backtrace debugging
183 option = get_option('execinfo')
184 if not option.disabled()
185     result = cc.check_header('execinfo.h')
186     if result
187         conf_data.set('HAVE_EXECINFO_H', 1)
188         summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Debugging', bool_yn : true)
189     else
190         summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
191     endif
192 else
193     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
194 endif
195
196 libarchive_dep = []
197 req_version = '>=3.4.0'
198 option = get_option('archive')
199 if not option.disabled()
200     libarchive_dep = dependency('libarchive', version : req_version, required : get_option('archive'))
201     if libarchive_dep.found()
202         conf_data.set('HAVE_ARCHIVE', 1)
203         summary({'archive' : ['archive files e.g. .zip supported:', true]}, section : 'Configuration', bool_yn : true)
204     else
205         summary({'archive' : ['libarchive ' + req_version + ' not found - archive files e.g. .zip supported::', false]}, section : 'Configuration', bool_yn : true)
206     endif
207 else
208     summary({'archive' : ['disabled - archive files e.g. .zip supported:', false]}, section : 'Configuration', bool_yn : true)
209 endif
210
211 lcms_dep = []
212 req_version = '>=2.0'
213 option = get_option('cms')
214 if not option.disabled()
215     xxd = find_program('xxd', 'xxdi.pl', required : false)
216     if xxd.found()
217         lcms_dep = dependency('lcms2', version : req_version, required : get_option('cms'))
218         if lcms_dep.found()
219             conf_data.set('HAVE_LCMS', 1)
220             conf_data.set('HAVE_LCMS2', 1)
221             summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
222         else
223             summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
224         endif
225     else
226         summary({'cms' : ['xxd or xxdi.pl not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
227     endif
228 else
229     summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)
230 endif
231
232 ddjvuapi_dep = []
233 req_version = '>=2.5.27'
234 option = get_option('djvu')
235 if not option.disabled()
236     ddjvuapi_dep = dependency('ddjvuapi', version : req_version, required : get_option('djvu'))
237     if ddjvuapi_dep.found()
238         conf_data.set('HAVE_DJVU', 1)
239         summary({'djvu' : ['djvu files supported:', true]}, section : 'Configuration', bool_yn : true)
240     else
241         summary({'djvu' : ['ddjvuapi ' + req_version + ' not found - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
242     endif
243 else
244     summary({'djvu' : ['disabled - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
245 endif
246
247 option = get_option('evince')
248 if not option.disabled()
249     evince = find_program('evince', required : false)
250     if evince.found()
251         summary({'print preview' : ['print preview supported:', true]}, section : 'Configuration', bool_yn : true)
252     else
253         summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
254     endif
255 else
256     summary({'print preview' : ['disabled - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
257 endif
258
259 # Required only for seg. fault stacktrace and backtrace debugging
260 option = get_option('execinfo')
261 if not option.disabled()
262     result = cc.check_header('execinfo.h')
263     if result
264         conf_data.set('HAVE_EXECINFO_H', 1)
265         summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Configuration', bool_yn : true)
266     else
267         summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
268     endif
269 else
270     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
271 endif
272
273 exiv2_dep = []
274 req_version = '>=0.11'
275 option = get_option('exiv2')
276 if not option.disabled()
277     exiv2_dep = dependency('exiv2', version : req_version, required : get_option('exiv2'))
278     if exiv2_dep.found()
279         conf_data.set('HAVE_EXIV2', 1)
280         summary({'exiv2' : ['image metadata processed by exiv2:', true]}, section : 'Configuration', bool_yn : true)
281     else
282         summary({'exiv2' : ['exiv2 ' + req_version + ' not found - image data not processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
283     endif
284 else
285     summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
286 endif
287
288 champlain_dep = []
289 champlain_gtk_dep = []
290 clutter_dep = []
291 clutter_gtk_dep = []
292 req_version_champlain = '>=0.12'
293 req_version_champlain_gtk = '>=0.12'
294 req_version_clutter = '>=1.0'
295 req_version_clutter_gtk = '>=1.0'
296 option = get_option('gps-map')
297 if not option.disabled()
298     champlain_dep = dependency('champlain-0.12', version : req_version_champlain, required : get_option('gps-map'))
299     champlain_gtk_dep = dependency('champlain-gtk-0.12', version : req_version_champlain_gtk, required : get_option('gps-map'))
300     if champlain_dep.found() and champlain_gtk_dep.found()
301         clutter_dep = dependency('clutter-1.0', version : req_version_clutter, required : get_option('gps-map'))
302         clutter_gtk_dep = dependency('clutter-gtk-1.0', version : req_version_clutter_gtk, required : get_option('gps-map'))
303         if clutter_dep.found() and clutter_gtk_dep.found()
304             conf_data.set('HAVE_CLUTTER', 1)
305             conf_data.set('HAVE_LIBCHAMPLAIN', 1)
306             conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 1)
307             summary({'gps-map' : ['GPS map displayed', true]}, section : 'Configuration', bool_yn : true)
308         else
309             if not clutter_dep.found()
310                 summary({'gps-map-clutter' : ['clutter-1.0 ' + req_version_clutter + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
311             endif
312             if not clutter_gtk_dep.found()
313                 summary({'gps-map-clutter-gtk' : ['clutter-gtk-1.0 ' + req_version_clutter_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
314             endif
315         endif
316     else
317         if not champlain_dep.found()
318             summary({'gps-map-champlain' : ['champlain-0.12 ' + req_version_champlain + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
319         endif
320         if not champlain_gtk_dep.found()
321             summary({'gps-map-champlain-gtk' : ['champlain-gtk-0.12 ' + req_version_champlain_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
322         endif
323     endif
324 else
325     summary({'gps-map' : ['disabled - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
326 endif
327
328 libheif_dep = []
329 req_version = '>=1.3.2'
330 option = get_option('heif')
331 if not option.disabled()
332     libheif_dep = dependency('libheif', version : req_version, required : get_option('heif'))
333     if libheif_dep.found()
334         conf_data.set('HAVE_HEIF', 1)
335         summary({'heif' : ['heif files supported:', true]}, section : 'Configuration', bool_yn : true)
336     else
337         summary({'heif' : ['libheif ' + req_version + ' not found - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
338     endif
339 else
340     summary({'heif' : ['disabled - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
341 endif
342
343 libopenjp2_dep = []
344 req_version = '>=2.3.0'
345 option = get_option('j2k')
346 if not option.disabled()
347     libopenjp2_dep = dependency('libopenjp2', version : req_version, required : get_option('j2k'))
348     if libopenjp2_dep.found()
349         conf_data.set('HAVE_J2K', 1)
350         summary({'j2k' : ['j2k files supported:', true]}, section : 'Configuration', bool_yn : true)
351     else
352         summary({'j2k' : ['libopenjp2 ' + req_version + ' not found - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
353     endif
354 else
355     summary({'j2k' : ['disabled - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
356 endif
357
358 libjpeg_dep = []
359 option = get_option('jpeg')
360 if not option.disabled()
361 libjpeg_dep = dependency('libjpeg', required : get_option('jpeg'))
362     if libjpeg_dep.found()
363         if cc.has_function('jpeg_destroy_decompress', dependencies : libjpeg_dep)
364             conf_data.set('HAVE_JPEG', 1)
365             summary({'jpeg' : ['jpeg files supported:', true]}, section : 'Configuration', bool_yn : true)
366         else
367             summary({'jpeg' : ['jpeg_destroy_decompress not found - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
368         endif
369     else
370         summary({'jpeg' : ['libjpeg: not found', false]}, section : 'Configuration', bool_yn : true)
371     endif
372 else
373     summary({'jpeg' : ['disabled - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
374 endif
375
376 libjxl_dep = []
377 req_version = '>=0.3.7'
378 option = get_option('jpegxl')
379 if not option.disabled()
380     libjxl_dep = dependency('libjxl', version : req_version, required : get_option('jpegxl'))
381     if libjxl_dep.found()
382         conf_data.set('HAVE_JPEGXL', 1)
383         summary({'jpegxl' : ['jpegxl files supported:', true]}, section : 'Configuration', bool_yn : true)
384     else
385         summary({'jpegxl' : ['libjxl ' + req_version + ' not found - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
386     endif
387 else
388     summary({'jpegxl' : ['disabled - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
389 endif
390
391 libraw_dep = []
392 req_version = '>=0.20'
393 option = get_option('libraw')
394 if not option.disabled()
395     libraw_dep = dependency('libraw', version : req_version, required : get_option('libraw'))
396     if libraw_dep.found()
397         conf_data.set('HAVE_RAW', 1)
398         summary({'libraw' : ['.cr3 files supported:', true]}, section : 'Configuration', bool_yn : true)
399     else
400         summary({'libraw' : ['libraw ' + req_version + ' not found - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
401     endif
402 else
403     summary({'libraw' : ['disabled - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
404 endif
405
406 lua_dep = []
407 req_version = '>=5.3'
408 option = get_option('lua')
409 if not option.disabled()
410     foreach name : ['lua', 'lua5.3', 'lua-5.3', 'lua53']
411         lua_dep = dependency(name, version: req_version, required: get_option('lua'))
412         if lua_dep.found()
413             break
414         endif
415     endforeach
416     if lua_dep.found()
417         conf_data.set('HAVE_LUA', 1)
418         summary({'lua' : ['lua supported:', true]}, section : 'Configuration', bool_yn : true)
419     else
420         summary({'lua' : ['lua ' + req_version + ' not found - lua supported:', false]}, section : 'Configuration', bool_yn : true)
421     endif
422 else
423     summary({'lua' : ['disabled - lua supported:', false]}, section : 'Configuration', bool_yn : true)
424 endif
425
426 option = get_option('pandoc')
427 if not option.disabled()
428     pandoc = find_program('pandoc', required : false)
429     if pandoc.found()
430         readme_html = custom_target(
431             'README.html',
432             input: 'README.md',
433             output: 'README.html',
434             command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
435             install: true,
436             install_dir: helpdir)
437
438         summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
439     else
440         summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
441     endif
442     install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', install_dir : helpdir)
443 else
444     summary({'pandoc' : ['disabled - README.html created:', false]}, section : 'Documentation', bool_yn : true)
445 endif
446
447 poppler_glib_dep = []
448 req_version = '>=0.62'
449 option = get_option('pdf')
450 if not option.disabled()
451     poppler_glib_dep = dependency('poppler-glib', version : req_version, required : get_option('pdf'))
452     if poppler_glib_dep.found()
453         conf_data.set('HAVE_PDF', 1)
454         summary({'pdf'  : ['pdf files supported:', true]}, section : 'Configuration', bool_yn : true)
455     else
456         summary({'pdf' : ['poppler-glib ' + req_version + ' not found - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
457     endif
458 else
459     summary({'pdf' : ['disabled - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
460 endif
461
462 gspell_dep = []
463 req_version = '>=1.6'
464 option = get_option('spell')
465 if not option.disabled()
466     gspell_dep = dependency('gspell-1', version : req_version, required: get_option('spell'))
467     if gspell_dep.found()
468         conf_data.set('HAVE_SPELL', 1)
469         summary({'spell' : ['spelling checks enabled', true]}, section : 'Configuration', bool_yn : true)
470     else
471         summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
472     endif
473 else
474     summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
475 endif
476
477 tiff_dep = []
478 option = get_option('tiff')
479 if not option.disabled()
480     tiff_dep = dependency('libtiff-4', required: get_option('tiff'))
481     if tiff_dep.found()
482         if cc.has_function('TIFFClientOpen', dependencies : tiff_dep)
483             conf_data.set('HAVE_TIFF', 1)
484             summary({'tiff' : ['tiff files supported:', true]}, section : 'Configuration', bool_yn : true)
485         else
486             summary({'tiff' : ['TIFFClientOpen not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
487         endif
488     else
489         summary({'tiff' : ['libtiff not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
490     endif
491 else
492     summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
493 endif
494
495 libffmpegthumbnailer_dep = []
496 req_version = '>=2.1.0'
497 option = get_option('videothumbnailer')
498 if not option.disabled()
499     libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer',
500         version : req_version,
501         required : get_option('videothumbnailer'))
502
503     if libffmpegthumbnailer_dep.found()
504         conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1)
505         summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
506
507         result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
508         if result
509             conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
510         endif
511         summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
512
513         result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
514         if result
515             conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
516         endif
517         summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
518
519         result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
520         if result
521             conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
522         endif
523         summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
524     else
525         summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
526     endif
527 else
528     summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
529 endif
530
531 # libpixbufloader-webp is not loaded as part of libgdk-pixbuf. Just issue
532 # a warning if not installed
533 libwebp_dir = dependency('gdk-pixbuf-2.0', method: 'pkg-config').get_variable('gdk_pixbuf_moduledir')
534 libwebp_dep = cc.find_library('libpixbufloader-webp', dirs : libwebp_dir, required : false)
535
536 if libwebp_dep.found()
537         summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
538 else
539         summary({'webp' : ['webp-pixbuf-loader not installed - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
540 endif
541
542 # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
543 code = '''#include <langinfo.h>
544 #include<stdio.h>
545 int main (int argc, char ** argv) {
546     char *c;
547     c =  nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
548     return 0;
549 }'''
550 if cc.links(code, name : 'nl_langinfo and _NL_TIME_FIRST_WEEKDAY')
551     conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 1)
552     summary({'nl_langinfo' : ['first weekday depends on locale:', true]}, section : 'Documentation', bool_yn : true)
553 else
554     summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true)
555 endif
556
557 conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
558 conf_data.set_quoted('GQ_APPDIR', gq_appdir)
559 conf_data.set_quoted('GQ_BINDIR', gq_bindir)
560 conf_data.set_quoted('GQ_HELPDIR', gq_helpdir)
561 conf_data.set_quoted('GQ_HTMLDIR', gq_htmldir)
562 conf_data.set_quoted('GQ_LOCALEDIR', gq_localedir)
563
564 conf_data.set_quoted('PACKAGE', meson.project_name())
565 conf_data.set_quoted('PACKAGE_NAME', meson.project_name())
566 conf_data.set_quoted('PACKAGE_STRING', meson.project_version())
567 conf_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
568 conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
569 conf_data.set_quoted('VERSION', meson.project_version())
570
571 configure_file(input : 'config.h.in',
572                output : 'config.h',
573                encoding : 'UTF-8',
574                configuration : conf_data)
575
576 # Process subdirs before the sources
577 subdir('po')
578 subdir('plugins')
579
580 # Generate the executable
581 subdir('src')
582
583 # Generate the help files
584 subdir('doc')
585
586 # Install other project files
587 if running_from_git
588     cmd = [find_program('gen_changelog.sh'), meson.current_source_dir(), meson.current_build_dir()]
589     custom_target(
590         'ChangeLog',
591         input: 'ChangeLog.gqview',
592         output: ['ChangeLog', 'ChangeLog.html'],
593         command: cmd,
594         install: true,
595         install_dir: helpdir)
596     meson.add_dist_script(cmd)
597     summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', true]}, section : 'Documentation', bool_yn : true)
598 elif fs.exists('ChangeLog.html')
599     install_data('ChangeLog', 'ChangeLog.html', install_dir: helpdir)
600     summary({'ChangeLog' : ['ChangeLog, ChangeLog.html installed from dist:', true]}, section : 'Documentation', bool_yn : true)
601 endif
602
603 install_data('geeqie.png', install_dir : icondir)
604 install_data('geeqie.1', install_dir : mandir1)
605
606 i18n.merge_file(
607     input : 'geeqie.desktop.in',
608     output : 'geeqie.desktop',
609     type : 'desktop',
610     po_dir : podir,
611     install : true,
612     install_dir : join_paths(datadir, 'applications'))
613
614 i18n.merge_file(
615     input : 'org.geeqie.Geeqie.appdata.xml.in',
616     output : 'org.geeqie.Geeqie.appdata.xml',
617     type : 'xml',
618     po_dir : podir,
619     install : true,
620     install_dir : appdatadir)
621
622 configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data)