Merge branch 'stable' into 'main'
[ladish.git] / meson.build
blob0ffadbdf3b9d7f796cb2c71576a41f9a0de8d873
1 project('ladish', 'c', 'cpp',
2   version : '1.2',
3   license : 'GPL-2.0-only')
5 data_dir = get_option('prefix') / 'share' / 'ladish'
6 locale_dir = get_option('prefix') / 'share' / 'locale'
7 dbus_name_base = 'org.ladish'
8 dbus_base_path = '/org/ladish'
10 fs = import('fs')
11 if fs.is_dir('.git')
12   # This block handles building from git source tree
13   # version.h is generated during build
14   git_version = run_command(['git', 'rev-parse', '--short', 'HEAD']).stdout().strip()
16   configure_file(output : 'version.h',
17                  configuration : {
18                                    'GIT_VERSION' : '"@0@"'.format(git_version)
19                  }
20   )
21 else
22   # Tarballs already have version.h,
23   # Just copy the file in this case
24   configure_file(output : 'version.h',
25                  input : 'version.h',
26                  copy: true
27   )
28 endif
30 configure_file(output : 'config.h',
31   configuration : {
32     'PACKAGE_VERSION' : '"@0@"'.format(meson.project_version()),
33     'BASE_NAME' : '"@0@"'.format(meson.project_name()),
34     'DATA_DIR' : '"@0@"'.format(data_dir),
35     'LOCALE_DIR' : '"@0@"'.format(locale_dir),
36     'DBUS_NAME_BASE' : '"@0@"'.format(dbus_name_base),
37     'DBUS_BASE_PATH' : '"@0@"'.format(dbus_base_path),
38     '_GNU_SOURCE' : 1,
39   }
42 cc = meson.get_compiler('c')
44 inc = include_directories(meson.build_root().split('/')[-1])
45 lash_inc = include_directories('lash_compat/liblash')
47 jack_dep = dependency('jack')
48 dbus_dep = dependency('dbus-1')
49 cdbus_dep = dependency('cdbus-1')
51 deps = [
52   cc.find_library('dl'),
53   cc.find_library('util'),
54   dbus_dep,
55   cdbus_dep,
56   jack_dep,
57   dependency('alsa'),
58   dependency('uuid'),
59   dependency('expat')
62 pkg_mod = import('pkgconfig')
64 subdir('common')
65 subdir('proxies')
66 subdir('alsapid')
68 # ladishd
69 subdir('daemon')
71 if get_option('liblash').enabled()
72   subdir('lash_compat/liblash')
73 endif
75 if get_option('gladish').enabled()
76   subdir('gui')
77   subdir('art')
78 endif
80 install_data(['AUTHORS', 'README.adoc', 'NEWS'], install_dir : data_dir)
82 install_data('ladish_control',
83              install_dir : get_option('prefix') / 'bin')
85 jmcore = executable('jmcore', 'jmcore.c',
86                     dependencies : deps,
87                     link_with : [commonlib],
88                     install : true)
90 ladiconfd = executable('ladiconfd', 'conf.c',
91                        dependencies : deps,
92                        link_with : [commonlib],
93                        install : true)