"Fossies" - the Fresh Open Source Software Archive

Member "glibmm-2.74.0/docs/reference/meson.build" (19 Sep 2022, 6142 Bytes) of package /linux/misc/glibmm-2.74.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "meson.build": 2.70.0_vs_2.72.0.

    1 # docs/reference
    2 
    3 # Input: built_files_root, project_source_root, glibmm_pcname, giomm_pcname,
    4 #        glibmm_hg_ccg_basenames, giomm_hg_ccg_basenames, build_documentation,
    5 #        glibmm_extra_h_files, giomm_extra_h_files, glibmm_built_h_file_targets,
    6 #        giomm_built_h_file_targets, glibmm_h_m4_files, install_datadir,
    7 #        python3, doc_reference_py, can_add_dist_script
    8 # Output: install_docdir, install_devhelpdir, if build_documentation: tag_file
    9 
   10 tag_file_modules = [
   11   'mm-common-libstdc++',
   12   'sigc++-3.0',
   13 ]
   14 doxygen_tagfiles = ''
   15 doxygen_tag_targets = []
   16 docinstall_flags = []
   17 foreach module : tag_file_modules
   18   depmod = dependency(module, required: false)
   19   if depmod.found()
   20     doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '')
   21     if doxytagfile != ''
   22       if depmod.type_name() == 'internal'
   23         # Subprojects must build their tag files before doxygen is called.
   24         if module.startswith('mm-common')
   25           doxygen_tag_targets += subproject('mm-common').get_variable('global_tag_file_target')
   26         else
   27           doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target')
   28         endif
   29       endif
   30       htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '')
   31       htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '')
   32       if htmlrefpub == ''
   33         htmlrefpub = htmlrefdir
   34       elif htmlrefdir == ''
   35         htmlrefdir = htmlrefpub
   36       endif
   37       doxygen_tagfiles += ' "' + doxytagfile + '=' + htmlrefpub + '"'
   38 
   39       # Doxygen <= 1.8.15
   40       docinstall_flags += ['-l', doxytagfile.split('/')[-1] + '@' + htmlrefdir]
   41       if htmlrefpub != htmlrefdir
   42         # Doxygen >= 1.8.16
   43         docinstall_flags += ['-l', 's@' + htmlrefpub + '@' + htmlrefdir]
   44       endif
   45     endif
   46   endif
   47 endforeach
   48 
   49 book_name = glibmm_pcname
   50 book_title = meson.project_name() + ' Reference Manual'
   51 
   52 # Configuration data for Doxyfile.
   53 doc_conf_data = configuration_data()
   54 doc_conf_data.set('configure_input',
   55   'docs/reference/Doxyfile. Generated from Doxyfile.in by meson.configure_file().')
   56 doc_conf_data.set('PACKAGE_NAME', meson.project_name())
   57 doc_conf_data.set('PACKAGE_VERSION', meson.project_version())
   58 doc_conf_data.set('abs_top_builddir', built_files_root)
   59 doc_conf_data.set('abs_top_srcdir', project_source_root)
   60 doc_conf_data.set('GLIBMM_MODULE_NAME', book_name)
   61 doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles)
   62 
   63 doxyfile = configure_file(
   64   input: 'Doxyfile.in',
   65   output: '@BASENAME@',
   66   configuration: doc_conf_data,
   67 )
   68 
   69 # Installation directories relative to {prefix}.
   70 install_docdir = install_datadir / 'doc' / book_name
   71 install_reference_docdir = install_docdir / 'reference'
   72 install_image_docdir = install_docdir / 'images'
   73 install_devhelpdir = install_datadir / 'devhelp' / 'books' / book_name
   74 
   75 if not build_documentation
   76   # Documentation shall not be built or installed.
   77   # Return to the calling meson.build file.
   78   subdir_done()
   79 endif
   80 
   81 # Built input .h files to Doxygen.
   82 built_h_files = []
   83 foreach file : glibmm_hg_ccg_basenames
   84   built_h_files += built_files_root / 'glib' / 'glibmm' / file + '.h'
   85 endforeach
   86 foreach file : glibmm_h_m4_files
   87   built_h_files += built_files_root / 'glib' / 'glibmm' / file
   88 endforeach
   89 foreach file : giomm_hg_ccg_basenames
   90   built_h_files += built_files_root / 'gio' / 'giomm' / file + '.h'
   91 endforeach
   92 
   93 # Hand-coded input .h files to Doxygen.
   94 src_h_files = []
   95 foreach file : glibmm_extra_h_files
   96   if file != 'wrap_init.h'
   97     src_h_files += project_source_root / 'glib' / 'glibmm' / file
   98   endif
   99 endforeach
  100 foreach file : giomm_extra_h_files
  101   if file != 'wrap_init.h'
  102     src_h_files += project_source_root / 'gio' / 'giomm' / file
  103   endif
  104 endforeach
  105 src_h_files += project_source_root / 'glib' / 'glibmm.h'
  106 src_h_files += project_source_root / 'gio' / 'giomm.h'
  107 
  108 doctool_dir = project_source_root / 'untracked' / 'docs' # MMDOCTOOLDIR
  109 doctool_dist_dir = 'untracked' / 'docs' # Relative to MESON_DIST_ROOT
  110 
  111 doc_h_files = src_h_files
  112 if glibmm_built_h_file_targets.length() + giomm_built_h_file_targets.length() > 0
  113   # .h files have been generated from .hg files (maintainer mode).
  114   # Use built_h_file_targets instead of built_h_files here, or else Meson won't
  115   # know that Doxygen must not be executed until the .h files have been built.
  116   doc_h_files += glibmm_built_h_file_targets + giomm_built_h_file_targets
  117 else
  118   # All .h files are stored in the source tree (not maintainer mode).
  119   doc_h_files += built_h_files
  120 endif
  121 
  122 # Can't use @INPUT@ in the command. It requires absolute file paths.
  123 # Paths in built_h_file_targets are relative to project_build_root.
  124 tag_file = custom_target('html_and_tag',
  125   input: doc_h_files,
  126   output: book_name + '.tag',
  127   command: [
  128     python3, doc_reference_py, 'doxygen',
  129     doctool_dir,
  130     '@OUTPUT@',
  131     src_h_files,
  132     built_h_files,
  133   ],
  134   depend_files: doxyfile,
  135   depends: doxygen_tag_targets,
  136   build_by_default: build_documentation,
  137   install: true,
  138   install_dir: install_reference_docdir,
  139 )
  140 
  141 devhelp_file = custom_target('devhelp',
  142   input: tag_file,
  143   output: book_name + '.devhelp2',
  144   command: [
  145     python3, doc_reference_py, 'devhelp',
  146     doctool_dir,
  147     '@INPUT@',
  148     '@OUTPUT@',
  149     book_name,
  150     book_title,
  151   ],
  152   build_by_default: build_documentation,
  153 )
  154 
  155 # Install Devhelp file and html files.
  156 meson.add_install_script(
  157   python3, doc_reference_py, 'install_doc',
  158   doctool_dir,
  159   devhelp_file.full_path(),
  160   install_devhelpdir,
  161   install_reference_docdir / 'html',
  162   docinstall_flags
  163 )
  164 
  165 # Install images.
  166 image_basefiles = [
  167   'gtkmm_logo.gif',
  168   'top.gif',
  169 ]
  170 image_files = []
  171 foreach file : image_basefiles
  172   image_files += '..' / 'images' / file
  173 endforeach
  174 
  175 install_data(image_files, install_dir: install_image_docdir)
  176 
  177 if can_add_dist_script
  178   # Distribute built files and files copied by mm-common-get.
  179   meson.add_dist_script(
  180     python3, doc_reference_py, 'dist_doc',
  181     doctool_dir,
  182     doctool_dist_dir,
  183     meson.current_build_dir(),
  184     tag_file.full_path(),
  185     devhelp_file.full_path(),
  186   )
  187 endif