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) |
Ed Tanous | ede5e5e | 2022-09-01 11:20:33 -0700 | [diff] [blame] | 3 | set (CMAKE_CXX_STANDARD 20) |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 4 | set (CMAKE_CXX_STANDARD_REQUIRED ON) |
Andrew Geissler | 1f0b833 | 2020-10-05 14:21:54 -0500 | [diff] [blame] | 5 | |
| 6 | # Temporarily disable rtti |
| 7 | # See https://github.com/chriskohlhoff/asio/issues/533 |
| 8 | #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") |
| 9 | #set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti") |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 10 | |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 11 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}) |
| 12 | find_package (Boost REQUIRED) |
| 13 | include_directories (${Boost_INCLUDE_DIRS}) |
| 14 | add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY) |
| 15 | add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED) |
| 16 | add_definitions (-DBOOST_ALL_NO_LIB) |
| 17 | add_definitions (-DBOOST_NO_RTTI) |
| 18 | add_definitions (-DBOOST_NO_TYPEID) |
| 19 | add_definitions (-DBOOST_ASIO_DISABLE_THREADS) |
| 20 | |
| 21 | set (SRC_FILES ipmbbridged.cpp ipmbutils.cpp) |
| 22 | |
| 23 | # import libsystemd |
| 24 | find_package (PkgConfig REQUIRED) |
| 25 | pkg_check_modules (SYSTEMD libsystemd REQUIRED) |
| 26 | |
| 27 | # import sdbusplus |
| 28 | find_package (PkgConfig REQUIRED) |
| 29 | pkg_check_modules (SDBUSPLUSPLUS sdbusplus REQUIRED) |
| 30 | |
| 31 | # import phosphor-logging |
| 32 | find_package (PkgConfig REQUIRED) |
| 33 | pkg_check_modules (LOGGING phosphor-logging REQUIRED) |
| 34 | |
| 35 | add_executable (${PROJECT_NAME} ${SRC_FILES}) |
| 36 | target_link_libraries (${PROJECT_NAME} systemd) |
| 37 | target_link_libraries (${PROJECT_NAME} boost_coroutine) |
| 38 | target_link_libraries (${PROJECT_NAME} sdbusplus -lstdc++fs) |
| 39 | target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES}) |
James Feist | a8c77dc | 2019-01-30 16:55:46 -0800 | [diff] [blame] | 40 | target_link_libraries (${PROJECT_NAME} phosphor_logging) |
| 41 | target_link_libraries (${PROJECT_NAME} i2c) |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 42 | |
| 43 | link_directories (${EXTERNAL_INSTALL_LOCATION}/lib) |
| 44 | |
| 45 | set (SERVICE_FILES ${PROJECT_SOURCE_DIR}/ipmb.service) |
Amithash Prasad | 314862d | 2019-03-26 11:14:03 -0700 | [diff] [blame] | 46 | set (CONFIG_FILES ${PROJECT_SOURCE_DIR}/ipmb-channels.json) |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 47 | |
Patrick Venture | 08deaa3 | 2019-03-28 13:27:32 -0700 | [diff] [blame] | 48 | install (TARGETS ${PROJECT_NAME} DESTINATION bin) |
Dawid Frycki | a642a94 | 2018-06-12 10:44:23 -0700 | [diff] [blame] | 49 | install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/) |
Amithash Prasad | 314862d | 2019-03-26 11:14:03 -0700 | [diff] [blame] | 50 | install (FILES ${CONFIG_FILES} DESTINATION /usr/share/ipmbbridge/) |