Adding intel-pfr-manager service

This commit adds the intel-pfr-manager service which creates the
dbus service, objects and interfaces by reading data from CPLD.
This is used to report PFR properties for use of user interfaces.
1) PFR provisioning status
2) BMC active/recovery version
3) BIOS active/recovery version
4) CPLD version

Tested:
Loaded new service and verified functionality using busctl.
End-to-end testing will be done with redfish interface.

Change-Id: I352a70fa9cb26a0e9e448e64e0b029fd18f9368a
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/service/CMakeLists.txt b/service/CMakeLists.txt
new file mode 100644
index 0000000..10377f1
--- /dev/null
+++ b/service/CMakeLists.txt
@@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
+project(intel-pfr-manager CXX)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+include(GNUInstallDirs)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)
+
+set(SRC_FILES src/mainapp.cpp src/pfr_mgr.cpp)
+
+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)
+add_definitions(-DBOOST_ASIO_DISABLE_THREADS)
+
+# import libsystemd
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(SYSTEMD libsystemd REQUIRED)
+include_directories(${SYSTEMD_INCLUDE_DIRS})
+link_directories(${SYSTEMD_LIBRARY_DIRS})
+
+# import sdbusplus
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(SDBUSPLUSPLUS sdbusplus REQUIRED)
+include_directories(${SDBUSPLUSPLUS_INCLUDE_DIRS})
+link_directories(${SDBUSPLUSPLUS_LIBRARY_DIRS})
+find_program(SDBUSPLUSPLUS sdbus++)
+
+# import phosphor-logging
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(LOGGING phosphor-logging REQUIRED)
+include_directories(${LOGGING_INCLUDE_DIRS})
+link_directories(${LOGGING_LIBRARY_DIRS})
+
+add_executable(${PROJECT_NAME} ${SRC_FILES})
+target_link_libraries(${PROJECT_NAME} systemd)
+target_link_libraries(${PROJECT_NAME} "${SDBUSPLUSPLUS_LIBRARIES} -lstdc++fs")
+target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
+target_link_libraries(${PROJECT_NAME} phosphor_logging)
+target_link_libraries(${PROJECT_NAME} pfr)
+target_link_libraries(${PROJECT_NAME} i2c)
+
+install(TARGETS ${PROJECT_NAME} DESTINATION bin)