meson.build 1.35 KB
Newer Older
Jordan Petridis's avatar
Jordan Petridis committed
1 2 3
# Adatped from:
# https://gitlab.gnome.org/danigm/fractal/blob/6e2911f9d2353c99a18a6c19fab7f903c4bbb431/meson.build

Jordan Petridis's avatar
Jordan Petridis committed
4 5
project(
  'hammond', 'rust',
Jordan Petridis's avatar
Jordan Petridis committed
6
  version: '0.3.4',
Jordan Petridis's avatar
Jordan Petridis committed
7 8 9 10 11 12 13 14 15 16 17 18
  license: 'GPLv3',
)

hammond_version = meson.project_version()
version_array = hammond_version.split('.')
hammond_major_version = version_array[0].to_int()
hammond_minor_version = version_array[1].to_int()
hammond_version_micro = version_array[2].to_int()

hammond_prefix = get_option('prefix')
hammond_bindir = join_paths(hammond_prefix, get_option('bindir'))

19 20 21
datadir = get_option('datadir')
icondir = join_paths(datadir, 'icons')
subdir('hammond-gtk/resources')
Jordan Petridis's avatar
Jordan Petridis committed
22 23

cargo = find_program('cargo', required: false)
24 25
gresource = find_program('glib-compile-resources', required: false)
cargo_vendor = find_program('cargo-vendor', required: false)
Jordan Petridis's avatar
Jordan Petridis committed
26
cargo_script = find_program('scripts/cargo.sh')
27

Jordan Petridis's avatar
Jordan Petridis committed
28 29
cargo_release = custom_target('cargo-build',
                        build_by_default: true,
30
                        build_always: true,
Jordan Petridis's avatar
Jordan Petridis committed
31 32 33
                        output: ['hammond'],
                        install: true,
                        install_dir: hammond_bindir,
34
                        command: [cargo_script, '@CURRENT_SOURCE_DIR@', '@OUTPUT@'])
Jordan Petridis's avatar
Jordan Petridis committed
35

36 37
run_target('release', command: ['scripts/release.sh',
                                meson.project_name() + '-' + hammond_version
38
                               ])