Fix meson file and remove warnings from compilation

Fixed meson file by applying proper dependency. Removed boost from
subprojects because boost does not support cmake and meson. User
is able to build boost manually or using a script
boost_build_1.74.0.sh and set BOOST_ROOT variable to build files.
Then reruning meson should detect boost dependency with positive
result.

Removed all warnings from compilation by applying a new flag for
boost - BOOST_ALLOW_DEPRECATED_HEADERS, after boost update this
flag should be removed. Changed tmpnam() with temp_directory_path
provided by std::filesystem.

Tested:
 - Built telemetry with success in cases when different components
   are not installed on system: nlohmann, sdbusplus, googletest,
   phosphor-logging.
 - Using BOOST_ROOT variable that points to installation location
   of boost allows to build telemetry wihtout boost installed on
   system.
 - Unit test passed.

Change-Id: I8d430f4c51b7bc6669c8533e1a76c4666efd4fc6
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
diff --git a/meson.build b/meson.build
index 1fc346d..68397c2 100644
--- a/meson.build
+++ b/meson.build
@@ -24,21 +24,22 @@
         '-DBOOST_ASIO_NO_DEPRECATED',
         '-DBOOST_NO_RTTI',
         '-DBOOST_NO_TYPEID',
+        # TODO: Removed below arg after upgrade to Boost 1.75
+        '-DBOOST_ALLOW_DEPRECATED_HEADERS',
         '-Wno-unused-parameter',
     ]),
     language: 'cpp'
 )
 
 boost = dependency(
-  'boost',
-  version: '>=1.74.0',
-  required: false,
-  modules: ['coroutine'])
-
-if not boost.found()
-    subproject('boost', required: false)
-    boost  = declare_dependency(include_directories: 'subprojects/boost_1_74_0')
-endif
+    'boost',
+    version: '>=1.74.0',
+    required: false,
+    modules: ['coroutine'])
+assert(boost.found(),
+       'Missing Boost 1.74.0 or higher, as WA you can set BOOST_ROOT ' +
+       'environemt to point at boost build. To build a boost you can use ' +
+       'script ./scripts/boost_build_1.74.0.sh')
 
 phosphor_logging = dependency('phosphor-logging', required: false)
 if not phosphor_logging.found()
@@ -48,29 +49,20 @@
     )
 endif
 
-sdbusplus = dependency('sdbusplus',required : false)
-if not sdbusplus.found()
-  sdbusplus_proj = subproject('sdbusplus', required: true)
-  sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
-endif
-
+sdbusplus = dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep'])
 systemd = dependency('systemd')
 
 if cpp.has_header('nlohmann/json.hpp')
     nlohmann_json = declare_dependency()
 else
-    subproject('nlohmann', required: false)
-    nlohmann_json = declare_dependency(
-        include_directories: [
-            'subprojects/nlohmann/single_include',
-            'subprojects/nlohmann/single_include/nlohmann',
-        ]
-    )
+    nlohmann_json = dependency('nlohmann_json',
+                               fallback: ['nlohmann', 'nlohmann_json_dep'])
 endif
 
 add_project_arguments(
     '-DTELEMETRY_MAX_REPORTS=' + get_option('max-reports').to_string(),
-    '-DTELEMETRY_MAX_READING_PARAMS=' + get_option('max-reading-parameters').to_string(),
+    '-DTELEMETRY_MAX_READING_PARAMS=' +
+        get_option('max-reading-parameters').to_string(),
     '-DTELEMETRY_MIN_INTERVAL=' + get_option('min-interval').to_string(),
     '-DTELEMETRY_MAX_TRIGGERS=' + get_option('max-triggers').to_string(),
     language: 'cpp'