ladish-1.2
[ladish.git] / meson.build
blobc8bb996f7a6efc404ec8b13668849fc312b7f95c
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 dbus_dep = dependency('dbus-1')
48 jack_dep = dependency('jack')
50 deps = [
51   cc.find_library('dl'),
52   cc.find_library('util'),
53   dbus_dep,
54   jack_dep,
55   dependency('alsa'),
56   dependency('uuid'),
57   dependency('expat')
60 pkg_mod = import('pkgconfig')
62 subdir('common')
63 subdir('proxies')
64 subdir('cdbus')
65 subdir('alsapid')
67 # ladishd
68 subdir('daemon')
70 if get_option('liblash').enabled()
71   subdir('lash_compat/liblash')
72 endif
74 if get_option('pylash').enabled()
75   subdir('lash_compat/pylash')
76 endif
78 if get_option('gladish').enabled()
79   subdir('gui')
80   subdir('art')
81 endif
83 install_data(['AUTHORS', 'README.adoc', 'NEWS'], install_dir : data_dir)
85 install_data('ladish_control',
86              install_dir : get_option('prefix') / 'bin')
88 jmcore = executable('jmcore', 'jmcore.c',
89                     dependencies : deps,
90                     link_with : [commonlib, cdbuslib],
91                     install : true)
93 ladiconfd = executable('ladiconfd', 'conf.c',
94                        dependencies : deps,
95                        link_with : [commonlib, cdbuslib],
96                        install : true)