Add the host error monitor with CATERR detection

This adds the host error monitor to monitor GPIOs for errors from
the host.  To start, it can detect and do basic handling of CATERR
assertions:

   1. Detect CATERR assertion
   2. Check power is on
   3. Make sure CATERR is held for at least 2 seconds
   4. Trigger crashdump
   5. Check the CATERR reset setting and power-cycle the system
      if enabled

Tested:
Injected an IERR and confirmed that it was detected and handled
correctly.

Change-Id: I444c0d92f66583c88e0f27b9870f92e1339c103e
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ce7dbc1
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,36 @@
+cmake_minimum_required (VERSION 3.6)
+project (host-error-monitor CXX)
+set (CMAKE_CXX_STANDARD 17)
+set (CMAKE_CXX_STANDARD_REQUIRED ON)
+
+add_executable (host-error-monitor src/host_error_monitor.cpp)
+
+target_include_directories (host-error-monitor PRIVATE ${CMAKE_SOURCE_DIR})
+
+target_link_libraries (host-error-monitor sdbusplus -lsystemd gpiodcxx)
+
+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+install (TARGETS host-error-monitor
+         RUNTIME DESTINATION bin
+         LIBRARY DESTINATION lib
+         ARCHIVE DESTINATION lib/static)
+
+find_package (Boost 1.66 REQUIRED)
+include_directories (${BOOST_SRC_DIR})
+
+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)
+
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
+
+set (
+    SERVICE_FILES
+    ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.HostErrorMonitor.service
+)
+install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)