xref: /openbmc/libmctp/CMakeLists.txt (revision cc0eddaa)
1383fb7b7SEd Tanouscmake_minimum_required (VERSION 3.5 FATAL_ERROR)
2383fb7b7SEd Tanous
3383fb7b7SEd Tanousadd_definitions (-DMCTP_LOG_STDERR)
4*cc0eddaaSJames Feistadd_definitions (-DMCTP_HAVE_FILEIO)
5383fb7b7SEd Tanous
66579c76dSJames Feistadd_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
7383fb7b7SEd Tanous
86579c76dSJames Feisttarget_include_directories (libmctp PUBLIC
96579c76dSJames Feist                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
10383fb7b7SEd Tanous                            $<INSTALL_INTERFACE:include/libmctp)
11383fb7b7SEd Tanous
12383fb7b7SEd Tanousenable_testing ()
13383fb7b7SEd Tanous
146579c76dSJames Feistadd_executable (test_eid tests/test_eid.c tests/test-utils.c)
156579c76dSJames Feisttarget_link_libraries (test_eid libmctp)
16383fb7b7SEd Tanous
176579c76dSJames Feistadd_executable (test_seq tests/test_seq.c tests/test-utils.c)
186579c76dSJames Feisttarget_link_libraries (test_seq libmctp)
19383fb7b7SEd Tanous
20383fb7b7SEd Tanousinstall (TARGETS libmctp DESTINATION lib)
21383fb7b7SEd Tanousinstall (FILES libmctp.h DESTINATION include)
226579c76dSJames Feist
23