Fix #1051: Add meson option to allow disabling doxygen detection
authorColin Clark <colin.clark@cclark.uk>
Sat, 26 Nov 2022 11:33:53 +0000 (11:33 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 26 Nov 2022 11:33:53 +0000 (11:33 +0000)
https://github.com/BestImageViewer/geeqie/pull/1051/commits/eaea66dec93dea0e7b1d3638961f4f32658ca602

Also include options for evince, git, pandoc and yelp-build

doc/meson.build
meson.build
meson_options.txt

index f2f5043..fe1c586 100644 (file)
@@ -18,22 +18,35 @@ destdir = join_paths(meson.current_build_dir(), 'html/')
 iconsdir = join_paths(meson.current_source_dir(), 'icons/')
 guideindex_ln = join_paths(destdir, 'index.html')
 
-# Not-found notification already handled by ../meson.build
-if gnome_doc_tool.found()
-    run_command(gnome_doc_tool, 'html', '-o', destdir, '-p', iconsdir, guideindex_xml, check : false)
-    run_command(find_program('ln'), '-s', '-f', 'GuideIndex.html', guideindex_ln, check : false)
+option = get_option('yelp-build')
+if not option.disabled()
+    gnome_doc_tool = find_program('yelp-build', required : false)
+    if gnome_doc_tool.found()
+        run_command(gnome_doc_tool, 'html', '-o', destdir, '-p', iconsdir, guideindex_xml, check : false)
+        run_command(find_program('ln'), '-s', '-f', 'GuideIndex.html', guideindex_ln, check : false)
+        summary({'help' : ['Help files created:', true]}, section : 'Documentation', bool_yn : true)
+    else
+        summary({'help' : ['yelp-build not found - Help files created:', false]}, section : 'Documentation', bool_yn : true)
+    endif
+else
+    summary({'help' : ['disabled - Help files created:', false]}, section : 'Documentation', bool_yn : true)
 endif
 
 install_subdir(destdir, install_dir : helpdir, exclude_directories : 'lua-api/latex')
 
-doxygen = find_program('doxygen', required : false)
-if doxygen.found() and running_from_git
-    srcdir = join_paths(meson.source_root())
-    destdir = join_paths(meson.build_root(), 'doc', 'html', 'lua-api')
-
-    run_command(find_program('create-doxygen-lua-api.sh'), srcdir, destdir, check : false)
-
-    summary({'lua-api' : ['lua-api help file created:', true]}, section : 'Documentation', bool_yn : true)
-else
-    summary({'lua-api' : ['doxygen not found - lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
+if running_from_git
+    option = get_option('doxygen')
+    if not option.disabled()
+        doxygen = find_program('doxygen', required : false)
+        if doxygen.found()
+            srcdir = join_paths(meson.source_root())
+            destdir = join_paths(meson.build_root(), 'doc', 'html', 'lua-api')
+            run_command(find_program('create-doxygen-lua-api.sh'), srcdir, destdir, check : false)
+            summary({'lua-api' : ['lua-api help file created:', true]}, section : 'Documentation', bool_yn : true)
+        else
+            summary({'lua-api' : ['doxygen not found - lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
+        endif
+    else
+        summary({'lua-api' : ['disabled - lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
+    endif
 endif
index d7c1f73..d9f2e95 100644 (file)
@@ -71,15 +71,15 @@ configuration_inc = include_directories('.')
 # External programs
 gdk_pixbuf_csource = find_program('gdk-pixbuf-csource', required : true)
 glib_genmarshal = find_program('glib-genmarshal', required : true)
-gnome_doc_tool = find_program('yelp-build', required : false)
-if gnome_doc_tool.found()
-    summary({'help' : ['Help files created:', true]}, section : 'Documentation', bool_yn : true)
+
+option = get_option('git')
+if not option.disabled()
+    running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
 else
-    summary({'help' : ['yelp-build not found - Help files created:', false]}, section : 'Documentation', bool_yn : true)
+    running_from_git = false
+    summary({'git' : ['disabled - ChangeLog, ChangeLog.html, lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
 endif
 
-running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
-
 debug = get_option('debug')
 
 # Note that main.cc sets prefix to the directory above where the executable is run from.
@@ -195,6 +195,18 @@ else
     summary({'djvu' : ['disabled - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+option = get_option('evince')
+if not option.disabled()
+    evince = find_program('evince', required : false)
+    if evince.found()
+        summary({'print preview' : ['print preview supported:', true]}, section : 'Configuration', bool_yn : true)
+    else
+        summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
+    endif
+else
+    summary({'print preview' : ['disabled - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
+endif
+
 exiv2_dep = []
 req_version = '>=0.11'
 option = get_option('exiv2')
@@ -210,42 +222,6 @@ else
     summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
-libffmpegthumbnailer_dep = []
-req_version = '>=2.1.0'
-option = get_option('videothumbnailer')
-if not option.disabled()
-    libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer',
-        version : req_version,
-        required : get_option('videothumbnailer'))
-
-    if libffmpegthumbnailer_dep.found()
-        conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1)
-        summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
-
-        result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
-        if result
-            conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
-        endif
-        summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
-
-        result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
-        if result
-            conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
-        endif
-        summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
-
-        result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
-        if result
-            conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
-        endif
-        summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
-    else
-        summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
-    endif
-else
-    summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
-endif
-
 champlain_dep = []
 champlain_gtk_dep = []
 clutter_dep = []
@@ -384,6 +360,27 @@ else
     summary({'lua' : ['disabled - lua supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+option = get_option('pandoc')
+if not option.disabled()
+    pandoc = find_program('pandoc', required : false)
+    if pandoc.found()
+        readme_html = custom_target(
+            'README.html',
+            input: 'README.md',
+            output: 'README.html',
+            command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
+            install: true,
+            install_dir: helpdir)
+
+        summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
+    else
+        summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
+    endif
+    install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', install_dir : helpdir)
+else
+    summary({'pandoc' : ['disabled - README.html created:', false]}, section : 'Documentation', bool_yn : true)
+endif
+
 poppler_glib_dep = []
 req_version = '>=0.62'
 option = get_option('pdf')
@@ -408,10 +405,10 @@ if not option.disabled()
         conf_data.set('HAVE_SPELL', 1)
         summary({'spell' : ['spelling checks enabled', true]}, section : 'Configuration', bool_yn : true)
     else
-        summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks not enabled', false]}, section : 'Configuration', bool_yn : true)
+        summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
     endif
 else
-    summary({'spell' : ['disabled - spelling checks not enabled', false]}, section : 'Configuration', bool_yn : true)
+    summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
 endif
 
 tiff_dep = []
@@ -432,6 +429,42 @@ else
     summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+libffmpegthumbnailer_dep = []
+req_version = '>=2.1.0'
+option = get_option('videothumbnailer')
+if not option.disabled()
+    libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer',
+        version : req_version,
+        required : get_option('videothumbnailer'))
+
+    if libffmpegthumbnailer_dep.found()
+        conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1)
+        summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
+
+        result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
+        if result
+            conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
+        endif
+        summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
+
+        result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
+        if result
+            conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
+        endif
+        summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
+
+        result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
+        if result
+            conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
+        endif
+        summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
+    else
+        summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
+    endif
+else
+    summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
+endif
+
 libwebp_dep = []
 req_version = '>=0.6.1'
 option = get_option('webp')
@@ -511,32 +544,6 @@ if running_from_git
 elif fs.exists('ChangeLog.html')
     install_data('ChangeLog', 'ChangeLog.html', install_dir: helpdir)
     summary({'ChangeLog' : ['ChangeLog, ChangeLog.html installed from dist:', true]}, section : 'Documentation', bool_yn : true)
-else
-    summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', false]}, section : 'Documentation', bool_yn : true)
-endif
-
-pandoc = find_program('pandoc', required : false)
-if pandoc.found()
-    readme_html = custom_target(
-        'README.html',
-        input: 'README.md',
-        output: 'README.html',
-        command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
-        install: true,
-        install_dir: helpdir)
-
-    summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
-else
-    summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
-endif
-install_data('README.md', 'COPYING', 'TODO', 'AUTHORS',
-             install_dir : helpdir)
-
-evince = find_program('evince', required : false)
-if evince.found()
-    summary({'print preview' : ['print preview supported:', true]}, section : 'Documentation', bool_yn : true)
-else
-    summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Documentation', bool_yn : true)
 endif
 
 install_data('geeqie.png', install_dir : icondir)
index b42a9ca..32a089f 100644 (file)
@@ -25,9 +25,11 @@ option('gq_localedir', type : 'string', value : '', description : 'Location wher
 
 option('archive', type : 'feature', value : 'auto', description : 'archive files e.g. zip, gz')
 option('cms', type : 'feature', value : 'auto', description : 'color management system')
+option('doxygen', type : 'feature', value : 'auto', description : 'lua api help file')
 option('djvu', type : 'feature', value : 'auto', description : 'djvu')
+option('evince', type : 'feature', value : 'auto', description : 'print preview')
 option('exiv2', type : 'feature', value : 'auto', description : 'exiv2')
-option('videothumbnailer', type : 'feature', value : 'auto', description : 'video thumbnailer')
+option('git', type : 'feature', value : 'auto', description : 'lua-api and changelog.html')
 option('gps-map', type : 'feature', value : 'auto', description : 'gps map')
 option('heif', type : 'feature', value : 'auto', description : 'heif')
 option('j2k', type : 'feature', value : 'auto', description : 'j2k')
@@ -35,7 +37,10 @@ option('jpeg', type : 'feature', value : 'auto', description : 'jpeg')
 option('jpegxl', type : 'feature', value : 'auto', description : 'jpegxl')
 option('libraw', type : 'feature', value : 'auto', description : 'libraw')
 option('lua', type : 'feature', value : 'auto', description : 'lua')
+option('pandoc', type : 'feature', value : 'auto', description : 'README.html')
 option('pdf', type : 'feature', value : 'auto', description : 'pdf')
 option('spell', type : 'feature', value : 'auto', description : 'spelling checks')
 option('tiff', type : 'feature', value : 'auto', description : 'tiff')
+option('videothumbnailer', type : 'feature', value : 'auto', description : 'video thumbnailer')
 option('webp', type : 'feature', value : 'auto', description : 'webp')
+option('yelp-build', type : 'feature', value : 'auto', description : 'help files')