xref: /openbmc/libmctp/CMakeLists.txt (revision 56c6ff12)
1383fb7b7SEd Tanouscmake_minimum_required (VERSION 3.5 FATAL_ERROR)
2383fb7b7SEd Tanous
3383fb7b7SEd Tanousadd_definitions (-DMCTP_LOG_STDERR)
4cc0eddaaSJames Feistadd_definitions (-DMCTP_HAVE_FILEIO)
5682232eaSAndrew Jefferyadd_definitions (-DMCTP_HAVE_STDIO)
69c99af2bSJames Feistadd_definitions (-DMCTP_DEFAULT_ALLOC)
7383fb7b7SEd Tanous
88e436af8SAndrew Jefferyadd_library (mctp STATIC alloc.c core.c log.c libmctp.h serial.c)
9383fb7b7SEd Tanous
108e436af8SAndrew Jefferytarget_include_directories (mctp PUBLIC
116579c76dSJames Feist                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
12383fb7b7SEd Tanous                            $<INSTALL_INTERFACE:include/libmctp)
13383fb7b7SEd Tanous
14383fb7b7SEd Tanousenable_testing ()
15383fb7b7SEd Tanous
166579c76dSJames Feistadd_executable (test_eid tests/test_eid.c tests/test-utils.c)
178e436af8SAndrew Jefferytarget_link_libraries (test_eid mctp)
18*56c6ff12SAndrew Jefferyadd_test (NAME eid COMMAND test_eid)
19383fb7b7SEd Tanous
206579c76dSJames Feistadd_executable (test_seq tests/test_seq.c tests/test-utils.c)
218e436af8SAndrew Jefferytarget_link_libraries (test_seq mctp)
22*56c6ff12SAndrew Jefferyadd_test (NAME seq COMMAND test_seq)
23383fb7b7SEd Tanous
248e436af8SAndrew Jefferyinstall (TARGETS mctp DESTINATION lib)
25383fb7b7SEd Tanousinstall (FILES libmctp.h DESTINATION include)
266579c76dSJames Feist
27