Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.5 FATAL_ERROR) |
| 2 | project (ipmbbridged CXX) |
| 3 | set (CMAKE_CXX_STANDARD 17) |
| 4 | set (CMAKE_CXX_STANDARD_REQUIRED ON) |
| 5 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 6 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
| 7 | |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 8 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}) |
| 9 | find_package (Boost REQUIRED) |
| 10 | include_directories (${Boost_INCLUDE_DIRS}) |
| 11 | add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 12 | add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED) |
| 13 | add_definitions (-DBOOST_ALL_NO_LIB) |
| 14 | add_definitions (-DBOOST_NO_RTTI) |
| 15 | add_definitions (-DBOOST_NO_TYPEID) |
| 16 | add_definitions (-DBOOST_ASIO_DISABLE_THREADS) |
| 17 | |
| 18 | set (SRC_FILES ipmbbridged.cpp ipmbutils.cpp) |
| 19 | |
| 20 | # import libsystemd |
| 21 | find_package (PkgConfig REQUIRED) |
| 22 | pkg_check_modules (SYSTEMD libsystemd REQUIRED) |
| 23 | |
| 24 | # import sdbusplus |
| 25 | find_package (PkgConfig REQUIRED) |
| 26 | pkg_check_modules (SDBUSPLUSPLUS sdbusplus REQUIRED) |
| 27 | |
| 28 | # import phosphor-logging |
| 29 | find_package (PkgConfig REQUIRED) |
| 30 | pkg_check_modules (LOGGING phosphor-logging REQUIRED) |
| 31 | |
| 32 | add_executable (${PROJECT_NAME} ${SRC_FILES}) |
| 33 | target_link_libraries (${PROJECT_NAME} systemd) |
| 34 | target_link_libraries (${PROJECT_NAME} boost_coroutine) |
| 35 | target_link_libraries (${PROJECT_NAME} sdbusplus -lstdc++fs) |
| 36 | target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES}) |
James Feist | a8c77dc | 2019-01-30 16:55:46 -0800 | [diff] [blame^] | 37 | target_link_libraries (${PROJECT_NAME} phosphor_logging) |
| 38 | target_link_libraries (${PROJECT_NAME} i2c) |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 39 | |
| 40 | link_directories (${EXTERNAL_INSTALL_LOCATION}/lib) |
| 41 | |
| 42 | set (SERVICE_FILES ${PROJECT_SOURCE_DIR}/ipmb.service) |
| 43 | |
| 44 | install (TARGETS ${PROJECT_NAME} DESTINATION sbin) |
| 45 | install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/) |