Move components from proving-ground

Move all needed components from proving ground to this
repo. Some clean up was done in json files to fix probes
as well as some slight modification to readme.

Change-Id: I05b7f6459704640c4850420a4573d157500d0aff
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755
index 0000000..638854f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,101 @@
+cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
+SET(BUILD_SHARED_LIBRARIES OFF)
+include(ExternalProject)
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++fs")
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
+
+option(HUNTER_ENABLED "Enable hunter package pulling" OFF)
+include("cmake/HunterGate.cmake")
+
+HunterGate(
+    URL "https://github.com/ruslo/hunter/archive/v0.18.64.tar.gz"
+    SHA1 "baf9c8cc4f65306f0e442b5419967b4c4c04589a"
+)
+
+project(enitity-manager)
+
+hunter_add_package(Boost)
+find_package(Boost REQUIRED)
+include_directories(${Boost_INCLUDE_DIRS})
+
+add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
+add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED)
+add_definitions(-DBOOST_ALL_NO_LIB)
+add_definitions(-DBOOST_NO_RTTI)
+add_definitions(-DBOOST_NO_TYPEID)
+
+hunter_add_package(dbus)
+find_package(dbus REQUIRED) # Include functions provided by PkgConfig module.
+include_directories(${DBUS_INCLUDE_DIRS})
+
+find_package(Threads REQUIRED)
+
+option(YOCTO "Enable Building in Yocto" OFF)
+
+if(NOT YOCTO)
+    ExternalProject_Add(boost-dbus
+        PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost-dbus
+        GIT_REPOSITORY ssh://git-amr-2.devtools.intel.com:29418/openbmc-boost-dbus
+        GIT_TAG fee38731bccba22b4157cc47afbf6434fec1eb6d
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DBOOST_ROOT=${BOOST_ROOT}
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ""
+        LOG_DOWNLOAD ON
+    )
+    ExternalProject_Get_Property(boost-dbus install_dir)
+    include_directories(${install_dir}/src/boost-dbus/include)
+
+    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/non-yocto)
+
+    ExternalProject_Add(nlohmann-json
+        PREFIX ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json
+        GIT_REPOSITORY https://github.com/nlohmann/json.git
+        GIT_TAG afebb6a3bbc8751e834a5472e5c53cb2b5bbd750
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND mkdir -p
+            ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json/src/nlohmann-json/src/nlohmann &&
+                cp ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json/src/nlohmann-json/src/json.hpp
+                ${CMAKE_CURRENT_BINARY_DIR}/nlohmann-json/src/nlohmann-json/src/nlohmann/json.hpp
+        INSTALL_COMMAND ""
+        LOG_DOWNLOAD ON
+    )
+
+    ExternalProject_Get_Property(nlohmann-json install_dir)
+    include_directories(${install_dir}/src/nlohmann-json/src)
+
+    option(ENABLE_TEST "Enable Google Test" OFF)
+    if(ENABLE_TEST)
+        hunter_add_package(GTest)
+        find_package(GTest CONFIG REQUIRED)
+        enable_testing()
+    endif()
+endif()
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+add_executable(fru-device src/FruDevice.cpp src/Utils.cpp)
+add_dependencies(fru-device boost-dbus)
+
+#add_dependencies(entity-manager nlohmann-json)
+target_link_libraries(fru-device  ${DBUS_LIBRARIES})
+target_link_libraries(fru-device pthread)
+target_link_libraries(fru-device stdc++fs)
+target_link_libraries(fru-device ${Boost_LIBRARIES})
+
+add_executable(entity-manager src/EntityManager.cpp src/Utils.cpp)
+add_dependencies(entity-manager boost-dbus)
+
+add_dependencies(entity-manager nlohmann-json)
+target_link_libraries(entity-manager  ${DBUS_LIBRARIES})
+target_link_libraries(entity-manager pthread)
+target_link_libraries(entity-manager stdc++fs)
+target_link_libraries(entity-manager ${Boost_LIBRARIES})
+
+install (TARGETS fru-device entity-manager DESTINATION bin)