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
116 binary_in = configuration_data()
117 binary_in.set('PYTHON', python_prg_path)
118 binary_in.set('PKG_CONFIG', pkgconfig_prg_path)
120 binary_in.set('PYTHON_PACKAGE_DIR', pkgpythondir)
122 binary_in.set('prefix', get_option('prefix'))
123 binary_in.set('datarootdir', join_paths('${prefix}', get_option('datadir')))
124 binary_in.set('datadir', '${datarootdir}')
126 binary_in.set('PACKAGE', package_name)
128 binary_in.set('VERSION', version)
130 foreach binary: gtkdoc_binaires
132 input: '@0@.in'.format(binary),
134 configuration: binary_in,
145 'version-greater-or-equal.xsl',
150 install_dir: pkgdatadir,
155 if get_option('autotools_support') == true
156 subdir('buildsystems/autotools')
159 if get_option('cmake_support') == true
160 subdir('buildsystems/cmake')
163 gtkdoc_pc = configuration_data()
164 gtkdoc_pc.set('prefix', prefix)
165 gtkdoc_pc.set('exec_prefix', '${prefix}')
166 gtkdoc_pc.set('datadir', join_paths('${prefix}', get_option('datadir')))
168 gtkdoc_pc.set('PACKAGE', package_name)
169 gtkdoc_pc.set('VERSION', version)
172 input: 'gtk-doc.pc.in',
173 output: 'gtk-doc.pc',
174 configuration: gtkdoc_pc,
176 install_dir: pkgconfigdir,
185 'gtk-doc @0@'.format(version),
188 ' prefix: @0@'.format(prefix),
189 ' bindir: @0@'.format(bindir),
190 ' libdir: @0@'.format(libdir),
191 ' datadir: @0@'.format(datadir),
194 ' Autotools support: @0@'.format(get_option('autotools_support')),
195 ' CMake support: @0@'.format(get_option('cmake_support')),
196 ' PDF output: @0@'.format(generate_pdf_output),
197 ' User manual: @0@'.format(get_option('yelp_manual')),
201 message('\n'.join(summary))