Vijay Khemka | abcc94f | 2020-08-11 15:27:44 -0700 | [diff] [blame^] | 1 | project( |
| 2 | 'phosphor-virtual-sensor', |
| 3 | 'cpp', |
| 4 | version: '1.0', |
| 5 | default_options: [ |
| 6 | 'cpp_std=c++17', |
| 7 | ], |
| 8 | ) |
| 9 | |
| 10 | executable( |
| 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 | |
| 25 | packagedir = join_paths( |
| 26 | get_option('prefix'), |
| 27 | get_option('datadir'), |
| 28 | meson.project_name(), |
| 29 | ) |
| 30 | |
| 31 | configfile = 'virtual_sensor_config.json' |
| 32 | confpath = '"' + join_paths( |
| 33 | packagedir, |
| 34 | configfile, |
| 35 | ) + '"' |
| 36 | |
| 37 | install_data(sources : configfile, install_dir : packagedir) |
| 38 | |
| 39 | conf_data = configuration_data() |
| 40 | conf_data.set('VIRTUAL_SENSOR_CONFIG_FILE', confpath) |
| 41 | |
| 42 | configure_file(output : 'config.hpp', |
| 43 | configuration : conf_data) |
| 44 | |
| 45 | systemd = dependency('systemd') |
| 46 | conf_data = configuration_data() |
| 47 | conf_data.set('bindir', get_option('prefix') / get_option('bindir')) |
| 48 | configure_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')) |