blob: 4c6fd3a709cd1727f4b69846efb0f86c563ab3e4 [file] [log] [blame]
Dawid Fryckia642a942018-06-12 10:44:23 -07001cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
2project (ipmbbridged CXX)
Ed Tanousede5e5e2022-09-01 11:20:33 -07003set (CMAKE_CXX_STANDARD 20)
Dawid Fryckia642a942018-06-12 10:44:23 -07004set (CMAKE_CXX_STANDARD_REQUIRED ON)
Andrew Geissler1f0b8332020-10-05 14:21:54 -05005
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 Fryckia642a942018-06-12 10:44:23 -070010
Dawid Fryckia642a942018-06-12 10:44:23 -070011include_directories (${CMAKE_CURRENT_SOURCE_DIR})
12find_package (Boost REQUIRED)
13include_directories (${Boost_INCLUDE_DIRS})
14add_definitions (-DBOOST_ERROR_CODE_HEADER_ONLY)
15add_definitions (-DBOOST_SYSTEM_NO_DEPRECATED)
16add_definitions (-DBOOST_ALL_NO_LIB)
17add_definitions (-DBOOST_NO_RTTI)
18add_definitions (-DBOOST_NO_TYPEID)
19add_definitions (-DBOOST_ASIO_DISABLE_THREADS)
20
21set (SRC_FILES ipmbbridged.cpp ipmbutils.cpp)
22
23# import libsystemd
24find_package (PkgConfig REQUIRED)
25pkg_check_modules (SYSTEMD libsystemd REQUIRED)
26
27# import sdbusplus
28find_package (PkgConfig REQUIRED)
29pkg_check_modules (SDBUSPLUSPLUS sdbusplus REQUIRED)
30
31# import phosphor-logging
32find_package (PkgConfig REQUIRED)
33pkg_check_modules (LOGGING phosphor-logging REQUIRED)
34
35add_executable (${PROJECT_NAME} ${SRC_FILES})
36target_link_libraries (${PROJECT_NAME} systemd)
37target_link_libraries (${PROJECT_NAME} boost_coroutine)
38target_link_libraries (${PROJECT_NAME} sdbusplus -lstdc++fs)
39target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES})
James Feista8c77dc2019-01-30 16:55:46 -080040target_link_libraries (${PROJECT_NAME} phosphor_logging)
41target_link_libraries (${PROJECT_NAME} i2c)
Dawid Fryckia642a942018-06-12 10:44:23 -070042
43link_directories (${EXTERNAL_INSTALL_LOCATION}/lib)
44
45set (SERVICE_FILES ${PROJECT_SOURCE_DIR}/ipmb.service)
Amithash Prasad314862d2019-03-26 11:14:03 -070046set (CONFIG_FILES ${PROJECT_SOURCE_DIR}/ipmb-channels.json)
Dawid Fryckia642a942018-06-12 10:44:23 -070047
Patrick Venture08deaa32019-03-28 13:27:32 -070048install (TARGETS ${PROJECT_NAME} DESTINATION bin)
Dawid Fryckia642a942018-06-12 10:44:23 -070049install (FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
Amithash Prasad314862d2019-03-26 11:14:03 -070050install (FILES ${CONFIG_FILES} DESTINATION /usr/share/ipmbbridge/)