Add button-handler framework

This new application will listen for button press
signals generated by the xyz.openbmc_project.Chassis.Buttons
code and perform the necessary actions, like powering off
when the power button is pressed.

This first commit is just the framework, and all of the
functionality will follow.

Change-Id: Ia877684627b53e0fcc6f4b0b82063811e8ced6ea
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 790a95b..f5c3078 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,8 +25,12 @@
     src/gpio.cpp
 )
 
-option (
-    LOOKUP_GPIO_BASE
+set(HANDLER_SRC_FILES
+    src/button_handler_main.cpp
+    src/button_handler.cpp
+)
+
+option (LOOKUP_GPIO_BASE
     "Look up the GPIO base value in /sys/class/gpio. Otherwise use a base of 0." ON
 )
 
@@ -55,6 +59,9 @@
 add_executable(${PROJECT_NAME} ${SRC_FILES} )
 target_link_libraries(${PROJECT_NAME} "${SDBUSPLUSPLUS_LIBRARIES} -lphosphor_dbus  -lstdc++fs")
 
+add_executable(button-handler ${HANDLER_SRC_FILES})
+target_link_libraries(button-handler "${SDBUSPLUSPLUS_LIBRARIES} -lphosphor_dbus")
+
 set (
     SERVICE_FILES
     ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.Chassis.Buttons.service
@@ -62,3 +69,4 @@
 
 install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
 install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_SBINDIR})
+install (TARGETS button-handler DESTINATION ${CMAKE_INSTALL_SBINDIR})