summaryrefslogtreecommitdiff
path: root/doc/meson.build
blob: de2a2b5d5775f7016198bb1a66e4edb5d8889220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
if build_docs
  dependency('gi-docgen', version: '>= 2021.6',
    fallback: ['gi-docgen', 'dummy_dep'],
  )

  gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))

  gweather_docdir = get_option('datadir') / 'doc'

  toml_conf = configuration_data()
  toml_conf.set('GWEATHER_VERSION', meson.project_version())

  gweather_toml = configure_file(
    input: 'libgweather.toml.in',
    output: 'libgweather.toml',
    configuration: toml_conf,
  )

  gweather_content_files = [
    'adding-locations.md',
    'migrating-3to4.md',
  ]

  custom_target('libgweather-doc',
    input: gweather_gir[0],
    output: libgweather_full_version,
    command: [
      gidocgen,
      'generate',
      '--quiet',
      '--fatal-warnings',
      '--config', gweather_toml,
      '--output-dir=@OUTPUT@',
      '--no-namespace-dir',
      '--content-dir=@0@'.format(meson.current_source_dir()),
      '@INPUT@',
    ],
    depend_files: [ gweather_toml, gweather_content_files ],
    build_by_default: true,
    install: true,
    install_dir: gweather_docdir,
  )
endif