xref: /openbmc/libmctp/CMakeLists.txt (revision 6579c76d)
1383fb7b7SEd Tanouscmake_minimum_required (VERSION 3.5 FATAL_ERROR)
2383fb7b7SEd Tanous
3383fb7b7SEd Tanousadd_definitions (-DMCTP_LOG_STDERR)
4383fb7b7SEd Tanousadd_definitions (-DMCTP_FILEIO)
5383fb7b7SEd Tanous
6*6579c76dSJames Feistadd_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
7383fb7b7SEd Tanous
8*6579c76dSJames Feisttarget_include_directories (libmctp PUBLIC
9*6579c76dSJames Feist                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
10383fb7b7SEd Tanous                            $<INSTALL_INTERFACE:include/libmctp)
11383fb7b7SEd Tanous
12383fb7b7SEd Tanousenable_testing ()
13383fb7b7SEd Tanous
14*6579c76dSJames Feistadd_executable (test_eid tests/test_eid.c tests/test-utils.c)
15*6579c76dSJames Feisttarget_link_libraries (test_eid libmctp)
16383fb7b7SEd Tanous
17*6579c76dSJames Feistadd_executable (test_seq tests/test_seq.c tests/test-utils.c)
18*6579c76dSJames Feisttarget_link_libraries (test_seq libmctp)
19383fb7b7SEd Tanous
20383fb7b7SEd Tanousinstall (TARGETS libmctp DESTINATION lib)
21383fb7b7SEd Tanousinstall (FILES libmctp.h DESTINATION include)
22*6579c76dSJames Feist
23