3 # Input: built_files_root, project_source_root, sigcxx_pcname,
4 # sigcxx_api_version, build_documentation, source_h_files,
5 # built_h_files, install_datadir, python3, doc_reference,
6 # built_h_file_targets, can_add_dist_script
7 # Output: install_docdir, install_devhelpdir, if build_documentation: tag_file
10 'mm-common-libstdc++',
13 doxygen_tag_targets = []
15 foreach module : tag_file_modules
16 depmod = dependency(module, required: false)
18 doxytagfile = depmod.get_variable(pkgconfig: 'doxytagfile', internal: 'doxytagfile', default_value: '')
20 if depmod.type_name() == 'internal'
21 # Subprojects must build their tag files before doxygen is called.
22 if module.startswith('mm-common')
23 doxygen_tag_targets += subproject('mm-common').get_variable('global_tag_file_target')
25 doxygen_tag_targets += subproject(module).get_variable('global_tag_file_target')
28 htmlrefpub = depmod.get_variable(pkgconfig: 'htmlrefpub', internal: 'htmlrefpub', default_value: '')
29 htmlrefdir = depmod.get_variable(pkgconfig: 'htmlrefdir', internal: 'htmlrefdir', default_value: '')
31 htmlrefpub = htmlrefdir
33 htmlrefdir = htmlrefpub
35 doxygen_tagfiles += ' "' + doxytagfile + '=' + htmlrefpub + '"'
38 docinstall_flags += ['-l', doxytagfile.split('/')[-1] + '@' + htmlrefdir]
39 if htmlrefpub != htmlrefdir
41 docinstall_flags += ['-l', 's@' + htmlrefpub + '@' + htmlrefdir]
47 book_name = 'lib' + sigcxx_pcname
48 book_title = meson.project_name() + ' Reference Manual'
50 # Configuration data for Doxyfile.
51 doc_conf_data = configuration_data()
52 doc_conf_data.set('configure_input',
53 'docs/docs/reference/Doxyfile. Generated from Doxyfile.in by meson.configure_file().')
54 doc_conf_data.set('PACKAGE_NAME', meson.project_name())
55 doc_conf_data.set('PACKAGE_VERSION', meson.project_version())
56 doc_conf_data.set('abs_top_builddir', built_files_root)
57 doc_conf_data.set('abs_top_srcdir', project_source_root)
58 doc_conf_data.set('SIGCXX_API_VERSION', sigcxx_api_version)
59 doc_conf_data.set('DOXYGEN_TAGFILES', doxygen_tagfiles)
61 doxyfile = configure_file(
64 configuration: doc_conf_data,
67 # Installation directories relative to {prefix}.
68 install_docdir = install_datadir / 'doc' / book_name
69 install_reference_docdir = install_docdir / 'reference'
70 install_devhelpdir = install_datadir / 'devhelp' / 'books' / book_name
72 if not build_documentation
73 # Documentation shall not be built or installed.
74 # Return to the calling meson.build file.
79 # Built input .h files to Doxygen.
81 foreach file : built_h_files
82 blt_h_files += built_files_root / 'sigc++' / file
85 # Hand-coded input .h files to Doxygen.
87 foreach file : source_h_files
88 src_h_files += project_source_root / 'sigc++' / file
90 src_h_files += project_source_root / 'sigc++' / 'sigc++.h'
92 doctool_dir = project_source_root / 'untracked' / 'docs' # MMDOCTOOLDIR
93 doctool_dist_dir = 'untracked' / 'docs' # Relative to MESON_DIST_ROOT
95 if built_h_file_targets.length() > 0
96 # .h files have been generated from .hg files (maintainer mode).
97 tag_file = custom_target('html_and_tag',
99 output: book_name + '.tag',
101 python3, doc_reference, 'doxygen',
107 depend_files: doxyfile,
108 depends: built_h_file_targets + doxygen_tag_targets,
109 build_by_default: build_documentation,
111 install_dir: install_reference_docdir,
114 # All .h files are stored in the source tree (not maintainer mode).
115 tag_file = custom_target('html_and_tag',
116 input: src_h_files + blt_h_files,
117 output: book_name + '.tag',
119 python3, doc_reference, 'doxygen',
124 depend_files: doxyfile,
125 depends: doxygen_tag_targets,
126 build_by_default: build_documentation,
128 install_dir: install_reference_docdir,
132 devhelp_file = custom_target('devhelp',
134 output: book_name + '.devhelp2',
136 python3, doc_reference, 'devhelp',
143 build_by_default: build_documentation,
146 # Install Devhelp file and html files.
147 meson.add_install_script(
148 python3, doc_reference, 'install_doc',
150 devhelp_file.full_path(),
152 install_reference_docdir / 'html',
156 if can_add_dist_script
157 # Distribute built files and files copied by mm-common-get.
158 meson.add_dist_script(
159 python3, doc_reference, 'dist_doc',
162 meson.current_build_dir(),
163 tag_file.full_path(),
164 devhelp_file.full_path(),