Jason M. Bills | 5e049d3 | 2018-10-19 12:59:38 -0700 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.6) |
| 2 | project (sel-logger CXX) |
| 3 | set (CMAKE_CXX_STANDARD 17) |
| 4 | set (CMAKE_CXX_STANDARD_REQUIRED ON) |
| 5 | |
| 6 | add_executable (sel-logger src/sel_logger.cpp) |
| 7 | |
| 8 | option ( |
| 9 | SEL_LOGGER_MONITOR_THRESHOLD_EVENTS |
| 10 | "Enable SEL Logger to monitor and automatically |
| 11 | log SEL records for threshold sensor events" |
| 12 | OFF |
| 13 | ) |
| 14 | target_compile_definitions ( |
| 15 | sel-logger PRIVATE |
| 16 | $<$<BOOL:${SEL_LOGGER_MONITOR_THRESHOLD_EVENTS}>: -DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS> |
| 17 | ) |
| 18 | |
| 19 | target_include_directories (sel-logger PRIVATE ${CMAKE_SOURCE_DIR}) |
| 20 | |
| 21 | target_link_libraries (sel-logger systemd sdbusplus pthread phosphor_logging) |
| 22 | |
| 23 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) |
| 24 | |
| 25 | install (TARGETS sel-logger |
| 26 | RUNTIME DESTINATION bin |
| 27 | LIBRARY DESTINATION lib |
| 28 | ARCHIVE DESTINATION lib/static) |
| 29 | |
| 30 | find_package (Boost 1.66 REQUIRED) |
| 31 | include_directories (${BOOST_SRC_DIR}) |
| 32 | |
| 33 | add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 34 | add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED) |
| 35 | add_definitions (-DBOOST_ALL_NO_LIB) |
| 36 | add_definitions (-DBOOST_NO_RTTI) |
| 37 | add_definitions (-DBOOST_NO_TYPEID) |
| 38 | |
| 39 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 40 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
| 41 | |
| 42 | set ( |
| 43 | SERVICE_FILES |
| 44 | ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.Logging.IPMI.service |
| 45 | ) |
| 46 | install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/) |