Add chassis intrusion sensor daemon

Chassis intrusion signal is read from PCH via I2C or from GPIO.
Create a new daemon to poll its status and expose to dbus.

Related patches to run test:
- meta-phosphor: dbus-sensors: Enable new service of intrusion sensor
https://gerrit.openbmc-project.xyz/#/c/openbmc/meta-phosphor/+/17063/
- redfish: chassis: add property of physical security
https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/17691/

Tested-by: Check intrusion status value by redfish,
verified PCH solution on WFP and GPIO solution on STP.

Change-Id: Id5e67abbd80bbf2ef502db49fa183d92d0d31bda
Signed-off-by: Qiang XU <qiang.xu@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7201ac0..498fcca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,8 @@
 
 set (IPMB_SRC_FILES src/Utils.cpp src/Thresholds.cpp)
 
+set (INTRUSION_SRC_FILES src/Utils.cpp src/ChassisIntrusionSensor.cpp)
+
 set (EXTERNAL_PACKAGES Boost sdbusplus-project nlohmann-json)
 set (SENSOR_LINK_LIBS -lsystemd stdc++fs sdbusplus)
 
@@ -133,6 +135,12 @@
 add_dependencies (ipmbsensor sdbusplus)
 target_link_libraries (ipmbsensor ${SENSOR_LINK_LIBS})
 
+add_executable (intrusionsensor src/IntrusionSensorMain.cpp
+                ${INTRUSION_SRC_FILES})
+add_dependencies (intrusionsensor sdbusplus-project)
+target_link_libraries (intrusionsensor ${SENSOR_LINK_LIBS})
+target_link_libraries (intrusionsensor i2c)
+
 if (NOT YOCTO)
     add_dependencies (fansensor ${EXTERNAL_PACKAGES})
     add_dependencies (hwmontempsensor ${EXTERNAL_PACKAGES})
@@ -140,6 +148,7 @@
     add_dependencies (cpusensor ${EXTERNAL_PACKAGES})
     add_dependencies (exitairtempsensor ${EXTERNAL_PACKAGES})
     add_dependencies (ipmbsensor ${EXTERNAL_PACKAGES})
+    add_dependencies (intrusionsensor ${EXTERNAL_PACKAGES})
 endif ()
 
 set (
@@ -150,8 +159,9 @@
     ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.hwmontempsensor.service
     ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.exitairsensor.service
     ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.ipmbsensor.service
+    ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.intrusionsensor.service
 )
 
 install (TARGETS fansensor hwmontempsensor cpusensor adcsensor ipmbsensor
-                 exitairtempsensor DESTINATION sbin)
+                 exitairtempsensor intrusionsensor DESTINATION sbin)
 install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)