blob: 4258e5ee569170eb59edd1c16ca036a7b393d883 [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
10executable(
11 'virtual-sensor',
12 [
13 'virtualSensor.cpp',
14 ],
15 dependencies: [
16 dependency('phosphor-logging'),
17 dependency('sdbusplus'),
18 dependency('phosphor-dbus-interfaces'),
19 dependency('sdeventplus'),
20 ],
21 install: true,
22 install_dir: get_option('bindir')
23)
24
25packagedir = join_paths(
26 get_option('prefix'),
27 get_option('datadir'),
28 meson.project_name(),
29)
30
31configfile = 'virtual_sensor_config.json'
32confpath = '"' + join_paths(
33 packagedir,
34 configfile,
35) + '"'
36
37install_data(sources : configfile, install_dir : packagedir)
38
39conf_data = configuration_data()
40conf_data.set('VIRTUAL_SENSOR_CONFIG_FILE', confpath)
41
42configure_file(output : 'config.hpp',
43 configuration : conf_data)
44
45systemd = dependency('systemd')
46conf_data = configuration_data()
47conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
48configure_file(
49 input: 'phosphor-virtual-sensor.service.in',
50 output: 'phosphor-virtual-sensor.service',
51 configuration: conf_data,
52 install: true,
53 install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'))