Basic initial implementation
This is a base implementation which does following
1. create a daemon,
2. parse config file and create a virtual sensor object
3. create list of virtual sensors for given config.
4. Creates a systemd unit file
It currently supports constant params only and dbus params will be in
follow up patch.
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
Change-Id: I89b2ffb8bff67bdbb3033071cba9f6e565a9af6e
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..4258e5e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,53 @@
+project(
+ 'phosphor-virtual-sensor',
+ 'cpp',
+ version: '1.0',
+ default_options: [
+ 'cpp_std=c++17',
+ ],
+)
+
+executable(
+ 'virtual-sensor',
+ [
+ 'virtualSensor.cpp',
+ ],
+ dependencies: [
+ dependency('phosphor-logging'),
+ dependency('sdbusplus'),
+ dependency('phosphor-dbus-interfaces'),
+ dependency('sdeventplus'),
+ ],
+ install: true,
+ install_dir: get_option('bindir')
+)
+
+packagedir = join_paths(
+ get_option('prefix'),
+ get_option('datadir'),
+ meson.project_name(),
+)
+
+configfile = 'virtual_sensor_config.json'
+confpath = '"' + join_paths(
+ packagedir,
+ configfile,
+) + '"'
+
+install_data(sources : configfile, install_dir : packagedir)
+
+conf_data = configuration_data()
+conf_data.set('VIRTUAL_SENSOR_CONFIG_FILE', confpath)
+
+configure_file(output : 'config.hpp',
+ configuration : conf_data)
+
+systemd = dependency('systemd')
+conf_data = configuration_data()
+conf_data.set('bindir', get_option('prefix') / get_option('bindir'))
+configure_file(
+ input: 'phosphor-virtual-sensor.service.in',
+ output: 'phosphor-virtual-sensor.service',
+ configuration: conf_data,
+ install: true,
+ install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'))