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