1 project('gtk-doc', 'c',
4 meson_version: '>= 0.41.0',
7 gnome = import('gnome')
8 python = import('python3')
11 version = meson.project_version()
12 version_arr = version.split('.')
13 version_major = version_arr[0].to_int()
14 version_minor = version_arr[1].to_int()
15 version_micro = version_arr[2].to_int()
17 package_name = meson.project_name()
20 srcdir = meson.source_root()
21 builddir = meson.build_root()
23 prefix = get_option('prefix')
25 bindir = join_paths(prefix, get_option('bindir'))
26 libdir = join_paths(prefix, get_option('libdir'))
27 datadir = join_paths(prefix, get_option('datadir'))
29 cmakedatadir = join_paths(libdir, 'cmake')
31 autoconfdatadir = join_paths(datadir, 'aclocal')
32 pkgdir = join_paths(datadir, package_name)
33 pkgdatadir = join_paths(pkgdir, 'data')
34 pkgpythondir = join_paths(pkgdir, 'python')
35 pkgconfigdir = join_paths(datadir, 'pkgconfig')
38 glib_req = '>= 2.38.0'
39 python3_req = '>= 3.4.0'
41 glib_dep = dependency('glib-2.0', version: glib_req)
42 gobject_dep = dependency('gobject-2.0', version: glib_req)
43 python3_dep = dependency('python3', version: python3_req)
45 python_prg = python.find_python()
47 pkgconfig_prg = find_program('pkg-config', required: true)
48 xsltproc_prg = find_program('xsltproc', required: true)
49 dblatex_prg = find_program('dblatex', required: false)
50 fop_prg = find_program('fop', required: false)
52 source_highlight_prg = find_program('source-highlight', required: false)
53 highlight_prg = find_program('highlight', required: false)
54 vim_prg = find_program('vim', required: false)
56 python_prg_path = join_paths(python_prg.path())
57 pkgconfig_prg_path = join_paths(pkgconfig_prg.path())
58 xsltproc_prg_path = join_paths(xsltproc_prg.path())
61 if dblatex_prg.found()
62 dblatex_prg_path = join_paths(dblatex_prg.path())
67 fop_prg_path = join_paths(fop_prg.path())
70 highlight_prg_path = ''
71 highlight_prg_args = ''
72 if source_highlight_prg.found()
73 highlight_prg_path = join_paths(source_highlight_prg.path())
74 highlight_prg_args = [
81 elif highlight_prg.found()
82 highlight_prg_path = join_paths(highlight_prg.path())
83 highlight_prg_args = [
87 '--class-name=gtkdoc',
90 highlight_prg_path = join_paths(vim_prg.path())
94 generate_pdf_output = true
95 if not dblatex_prg.found() and not fop_prg.found()
96 generate_pdf_output = false
117 binary_in = configuration_data()
118 binary_in.set('PYTHON', python_prg_path)
119 binary_in.set('PKG_CONFIG', pkgconfig_prg_path)
121 binary_in.set('PYTHON_PACKAGE_DIR', pkgpythondir)
123 binary_in.set('prefix', get_option('prefix'))
124 binary_in.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
125 binary_in.set('datadir', '${datarootdir}')
127 binary_in.set('PACKAGE', package_name)
129 binary_in.set('VERSION', version)
131 foreach binary: gtkdoc_binaires
133 input: '@0@.in'.format(binary),
135 configuration: binary_in,
147 'version-greater-or-equal.xsl',
152 install_dir: pkgdatadir,
157 if get_option('autotools_support') == true
158 subdir('buildsystems/autotools')
161 if get_option('cmake_support') == true
162 subdir('buildsystems/cmake')
165 gtkdoc_pc = configuration_data()
166 gtkdoc_pc.set('prefix', prefix)
167 gtkdoc_pc.set('exec_prefix', '${prefix}')
168 gtkdoc_pc.set('datadir', join_paths('${prefix}', get_option('datadir')))
170 gtkdoc_pc.set('PACKAGE', package_name)
171 gtkdoc_pc.set('VERSION', version)
174 input: 'gtk-doc.pc.in',
175 output: 'gtk-doc.pc',
176 configuration: gtkdoc_pc,
178 install_dir: pkgconfigdir,
187 'gtk-doc @0@'.format(version),
190 ' prefix: @0@'.format(prefix),
191 ' bindir: @0@'.format(bindir),
192 ' libdir: @0@'.format(libdir),
193 ' datadir: @0@'.format(datadir),
196 ' Autotools support: @0@'.format(get_option('autotools_support')),
197 ' CMake support: @0@'.format(get_option('cmake_support')),
198 ' PDF output: @0@'.format(generate_pdf_output),
199 ' User manual: @0@'.format(get_option('yelp_manual')),
203 message('\n'.join(summary))