Ed Tanous | f61ca6f | 2019-08-15 15:09:05 -0700 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) |
| 2 | project(power-control CXX) |
| 3 | set(CMAKE_CXX_STANDARD 17) |
| 4 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 5 | |
| 6 | add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 7 | add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED) |
| 8 | add_definitions(-DBOOST_ALL_NO_LIB) |
| 9 | add_definitions(-DBOOST_NO_RTTI) |
| 10 | add_definitions(-DBOOST_NO_TYPEID) |
| 11 | add_definitions(-DBOOST_ASIO_DISABLE_THREADS) |
| 12 | |
| 13 | set(SRC_FILES src/power_control.cpp) |
| 14 | |
| 15 | add_executable(${PROJECT_NAME} ${SRC_FILES}) |
| 16 | target_link_libraries(${PROJECT_NAME} -lstdc++fs) |
| 17 | target_link_libraries(${PROJECT_NAME} chassisi2c) |
| 18 | target_link_libraries(${PROJECT_NAME} i2c) |
| 19 | target_link_libraries(${PROJECT_NAME} gpiodcxx) |
| 20 | target_link_libraries(${PROJECT_NAME} systemd) |
| 21 | target_link_libraries(${PROJECT_NAME} sdbusplus) |
| 22 | |
| 23 | install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 24 | |
| 25 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 26 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
| 27 | |
| 28 | set( |
| 29 | SERVICE_FILES |
Vijay Khemka | b0c613a | 2020-05-06 11:11:04 -0700 | [diff] [blame] | 30 | ${PROJECT_SOURCE_DIR}/service_files/chassis-system-reset.service |
| 31 | ${PROJECT_SOURCE_DIR}/service_files/chassis-system-reset.target |
Ed Tanous | f61ca6f | 2019-08-15 15:09:05 -0700 | [diff] [blame] | 32 | ${PROJECT_SOURCE_DIR}/service_files/xyz.openbmc_project.Chassis.Control.Power.service |
| 33 | ) |
| 34 | install(FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/) |