From b62f5556350c8d40e9bad7a659b3d41cfffe4ce2 Mon Sep 17 00:00:00 2001
From: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Date: Fri, 11 Feb 2022 09:55:40 -0500
Subject: [PATCH] make doxygen to required

---
 doc/doxygen/meson.build | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/doc/doxygen/meson.build b/doc/doxygen/meson.build
index b500bac..e3062e3 100644
--- a/doc/doxygen/meson.build
+++ b/doc/doxygen/meson.build
@@ -8,31 +8,34 @@ doc_layout_files = files([
   'footer.html'
 ])
 
-doxygen = find_program('doxygen', required : false)
 
 #Build a Doxyfile based on Doxyfile.in
 cdata_doc = configuration_data()
 cdata_doc.set('VERSION', meson.project_version())
-cdata_doc.set('SRCDIR', meson.project_source_root())
-cdata_doc.set('BUILDDIR', meson.project_build_root())
+cdata_doc.set('SRCDIR', meson.source_root())
+cdata_doc.set('BUILDDIR', meson.build_root())
 if find_program('dot', required : false).found()
   cdata_doc.set('HAVE_DOT', 'YES')
 else
   cdata_doc.set('HAVE_DOT', 'NO')
 endif
 
-doxy_file = configure_file(
-  input : 'Doxyfile.in',
-  output : 'Doxyfile',
-  configuration : cdata_doc,
-  install : false,
-)
+doxygen = find_program('doxygen', required : false)
+
+if doxygen.found()
+  doxy_file = configure_file(
+    input : 'Doxyfile.in',
+    output : 'Doxyfile',
+    configuration : cdata_doc,
+    install : false,
+  )
 
-custom_target('doc',
-  input : doxy_file,
-  output : 'html',
-  depend_files : [doc_layout_files, main, cmplib_sources],
-  command : [doxygen, '@INPUT@'],
-  build_by_default : false,
-  console : true,
-)
+  custom_target('doc',
+    input : doxy_file,
+    output : 'html',
+    depend_files : [doc_layout_files, main, cmplib_sources],
+    command : [doxygen, '@INPUT@'],
+    build_by_default : false,
+    console : true,
+  )
+endif
-- 
GitLab