build: add wrapfiles for dependencies

Update meson.build and add wrapfiles so that all dependencies
are handled as subprojects.  This allows builds completely
outside of bitbake or an SDK.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Id9e46013671d1d407b13549c29c15770c1c6fb2c
diff --git a/meson.build b/meson.build
index de28513..8fcb47e 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,17 @@
     )
 endif
 
+if cpp.has_header('nlomann/json.hpp')
+    nlohmann_json = declare_dependency()
+else
+    subproject('nlohmann-json')
+    nlohmann_json = declare_dependency(
+        include_directories: [
+            'subprojects/nlohmann-json/single_include',
+            'subprojects/nlohmann-json/single_include/nlohmann',
+        ]
+    )
+endif
 
 executable(
     'virtual-sensor',
@@ -24,12 +35,28 @@
         'virtualSensor.cpp',
     ],
     dependencies: [
-        dependency('phosphor-logging'),
-        dependency('sdbusplus'),
-        dependency('phosphor-dbus-interfaces'),
-        dependency('sdeventplus'),
+        dependency(
+            'phosphor-logging',
+            fallback: ['phosphor-logging', 'phosphor_logging_dep'],
+        ),
+        dependency(
+            'sdbusplus',
+            fallback: ['sdbusplus', 'sdbusplus_dep' ],
+        ),
+        dependency(
+            'phosphor-dbus-interfaces',
+            fallback: [
+                'phosphor-dbus-interfaces',
+                'phosphor_dbus_interfaces_dep'
+            ],
+        ),
+        dependency(
+            'sdeventplus',
+            fallback: ['sdeventplus', 'sdeventplus_dep'],
+        ),
         dependency('fmt'),
         exprtk,
+        nlohmann_json,
     ],
     install: true,
     install_dir: get_option('bindir')