blob: de28513657d27fed10a71ea74fbc75b7b59b9ea6 [file] [log] [blame]
Vijay Khemkaabcc94f2020-08-11 15:27:44 -07001project(
2 'phosphor-virtual-sensor',
3 'cpp',
4 version: '1.0',
5 default_options: [
6 'cpp_std=c++17',
7 ],
8)
9
Vijay Khemka3ed9a512020-08-21 16:13:05 -070010cpp = meson.get_compiler('cpp')
11if cpp.has_header('exprtk.hpp')
12 exprtk = declare_dependency()
13else
14 subproject('exprtk', required: false)
15 exprtk = declare_dependency(
16 include_directories: 'subprojects/exprtk'
17 )
18endif
19
20
Vijay Khemkaabcc94f2020-08-11 15:27:44 -070021executable(
22 'virtual-sensor',
23 [
24 'virtualSensor.cpp',
25 ],
26 dependencies: [
27 dependency('phosphor-logging'),
28 dependency('sdbusplus'),
29 dependency('phosphor-dbus-interfaces'),
30 dependency('sdeventplus'),
Matt Spinlerddc6dcd2020-11-09 11:16:31 -060031 dependency('fmt'),
Vijay Khemka3ed9a512020-08-21 16:13:05 -070032 exprtk,
Vijay Khemkaabcc94f2020-08-11 15:27:44 -070033 ],
34 install: true,
35 install_dir: get_option('bindir')
36)
37
38packagedir = join_paths(
39 get_option('prefix'),
40 get_option('datadir'),
41 meson.project_name(),
42)
43
44configfile = 'virtual_sensor_config.json'
45confpath = '"' + join_paths(
46 packagedir,
47 configfile,
48) + '"'
49
50install_data(sources : configfile, install_dir : packagedir)
51
52conf_data = configuration_data()
53conf_data.set('VIRTUAL_SENSOR_CONFIG_FILE', confpath)
54
55configure_file(output : 'config.hpp',
56 configuration : conf_data)
57
58systemd = dependency('systemd')
59conf_data = configuration_data()
60conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
61configure_file(
62 input: 'phosphor-virtual-sensor.service.in',
63 output: 'phosphor-virtual-sensor.service',
64 configuration: conf_data,
65 install: true,
66 install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'))