Move bmcweb over to sdbusplus

This patchset moves bmcweb from using boost-dbus over entirely to
sdbusplus.  This has some nice improvements in performance (about 30%
of CPU cycles saved in dbus transactions), as well as makes this
project manuver closer to the upstream way of thinking.

Changes to bmcweb are largely ceremonial, and fall into a few
categories:
1. Moves async_method_call instances to the new format, and deletes any
use of the "endpoint" object in leiu of the sdbusplus style interface
2. sdbus object_path object doesn't allow access to the string
directly, so code that uses it moves to explicit casts.
3. The mapbox variant, while attempting to recreate boost::variant,
misses a T* get<T*>() method implementation, which allows using variant
without exceptions.  Currently, there is an overload for
mapbox::get_ptr implementation which replecates the functionality.

Tested by: Booting the bmcweb on a target, iterating through redfish
basic phosphor-webui usage, and websockets usage

Change-Id: I2d95882908d6eb6dba00b9219a221dd96449ca7b
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 869fc48..3ff1182 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,7 +63,8 @@
 endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
 
 if(NOT ${YOCTO_DEPENDENCIES}) # Download and unpack googletest at configure time
-  configure_file(CMakeLists.txt.in 3rdparty/CMakeLists.txt)
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+                 3rdparty/CMakeLists.txt)
   execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
                   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty)
   execute_process(COMMAND ${CMAKE_COMMAND} --build .
@@ -80,8 +81,20 @@
 add_definitions(-DBOOST_NO_TYPEID)
 # set(Boost_USE_STATIC_LIBS ON)
 
-find_package(Boost 1.64 REQUIRED)
-include_directories(${Boost_INCLUDE_DIRS})
+#find_package(Boost 1.66 REQUIRED)
+include_directories(${CMAKE_BINARY_DIR}/boost-src)
+
+# sdbusplus
+if(NOT ${YOCTO_DEPENDENCIES})
+  include_directories(${CMAKE_BINARY_DIR}/sdbusplus-src
+                     ${CMAKE_BINARY_DIR}/prefix/include)
+  set(WANT_TRANSACTION 0)
+
+  configure_file(${CMAKE_BINARY_DIR}/sdbusplus-src/sdbusplus/server.hpp.in
+                ${CMAKE_BINARY_DIR}/prefix/include/sdbusplus/server.hpp @ONLY)
+  configure_file(${CMAKE_BINARY_DIR}/sdbusplus-src/sdbusplus/bus.hpp.in
+                ${CMAKE_BINARY_DIR}/prefix/include/sdbusplus/bus.hpp @ONLY)
+endif()
 
 # Openssl
 find_package(OpenSSL REQUIRED)
@@ -96,6 +109,9 @@
   add_definitions(-DCROW_ENABLE_DEBUG)
 endif(CMAKE_BUILD_TYPE MATCHES Debug)
 
+#add_definitions(-DCROW_ENABLE_LOGGING)
+#add_definitions(-DCROW_ENABLE_DEBUG)
+
 add_definitions(-DCROW_ENABLE_SSL)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/crow/include)
 
@@ -113,9 +129,6 @@
 
 add_definitions("-Wno-attributes")
 
-# Boost-dbus
-find_package(boost-dbus REQUIRED)
-
 # tinyxml2
 find_package(tinyxml2 REQUIRED)
 
@@ -168,7 +181,6 @@
   target_link_libraries(webtest ${GMOCK_LIBRARIES})
 
   target_link_libraries(webtest pthread)
-  target_link_libraries(webtest boost-dbus)
   target_link_libraries(webtest ${OPENSSL_LIBRARIES})
   target_link_libraries(webtest ${ZLIB_LIBRARIES})
   target_link_libraries(webtest pam)
@@ -182,7 +194,6 @@
 
 # bmcweb
 add_executable(bmcweb ${WEBSERVER_MAIN} ${HDR_FILES} ${SRC_FILES})
-target_link_libraries(bmcweb boost-dbus)
 target_link_libraries(bmcweb pthread)
 target_link_libraries(bmcweb ${OPENSSL_LIBRARIES})
 target_link_libraries(bmcweb ${ZLIB_LIBRARIES})
@@ -190,6 +201,7 @@
 target_link_libraries(bmcweb -lsystemd)
 target_link_libraries(bmcweb -lstdc++fs)
 target_link_libraries(bmcweb tinyxml2)
+target_link_libraries(bmcweb sdbusplus)
 install(TARGETS bmcweb DESTINATION bin)
 
 add_executable(getvideo src/getvideo_main.cpp)