xeme/xeme

841b70e8dbf5
Make sure the gir target is added to the dependency

Also clean up some variable names to match our other projects.

Testing Done:
Ran the following without issue

```
meson setup --wipe -Dintrospection=false -Ddoc=false build-no-introspection
ninja -C build-no-introspection/ turtles
```

Reviewed at https://reviews.imfreedom.org/r/2952/
project('xeme', 'C',
default_options : ['c_std=c17', 'warning_level=3'],
license : 'LGPL-2.1-or-later',
meson_version : '>=1.0.0',
version : '0.1.0')
toplevel_inc = include_directories('.')
gnome = import('gnome')
pkgconfig = import('pkgconfig')
###############################################################################
# Versioning
###############################################################################
parts = meson.project_version().split('-')
if parts.length() > 1
extra = parts[1]
else
extra = ''
endif
parts = parts[0].split('.')
XEME_MAJOR_VERSION = parts[0]
XEME_MINOR_VERSION = parts[1]
XEME_MICRO_VERSION = parts[2]
XEME_LIB_VERSION = f'@XEME_MAJOR_VERSION@.@XEME_MINOR_VERSION@.@XEME_MICRO_VERSION@'
version_config = configuration_data()
version_config.set('XEME_MAJOR_VERSION', XEME_MAJOR_VERSION)
version_config.set('XEME_MINOR_VERSION', XEME_MINOR_VERSION)
version_config.set('XEME_MICRO_VERSION', XEME_MICRO_VERSION)
version_config.set('XEME_EXTRA_VERSION', extra)
version_config.set('XEME_VERSION', meson.project_version())
###############################################################################
# Dependencies
###############################################################################
glib_dep = dependency('glib-2.0', version : '>=2.76.0')
gio_dep = dependency('gio-2.0')
gobject_dep = dependency('gobject-2.0')
birb_dep = dependency('birb')
add_project_arguments(
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_76',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_76',
language : 'c',)
###############################################################################
# Internationalization
###############################################################################
GETTEXT_PACKAGE = 'xeme'
LOCALE_DIR = get_option('prefix') / get_option('localedir')
add_project_arguments(f'-DLOCALEDIR="@LOCALE_DIR@"', language : 'c')
add_project_arguments(f'-DGETTEXT_PACKAGE="@GETTEXT_PACKAGE@"', language : 'c')
###############################################################################
# Documentation
###############################################################################
if get_option('doc') and not get_option('introspection')
error('Documentation requires GObject Introspection.')
endif
gidocgen_dep = dependency(
'gi-docgen', version: '>= 2023.1',
fallback: ['gi-docgen', 'dummy_dep'],
required: get_option('doc')
)
gidocgen = find_program('gi-docgen', required : get_option('doc'))
docs_dir = get_option('prefix') / get_option('datadir') / 'doc'
doc_targets = []
###############################################################################
# Sub directories
###############################################################################
subdir('xeme')
subdir('po')
###############################################################################
# Custom Targets
###############################################################################
if meson.backend() == 'ninja'
run_target('turtles',
command : ['ninja', '-C', '@BUILD_ROOT@', 'xeme-pot', 'all', 'test'])
endif
# This needs to be after all of the sub-directories have been processed.
if get_option('doc')
alias_target('doc', doc_targets)
endif
###############################################################################
# Summarize all the things!
###############################################################################
summary({
'prefix': get_option('prefix'),
'bindir': get_option('bindir'),
'libdir': get_option('libdir'),
'datadir': get_option('datadir'),
}, section : 'Directories')
summary({
'documentation': get_option('doc'),
'internationalization': get_option('nls'),
'introspection': get_option('introspection'),
}, section : 'Options')