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