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