blob: a5b1042f02532b8e4674b938a6b02b6a65dae39e [file] [log] [blame]
James Feist6579c762019-06-13 10:45:00 -07001cmake_minimum_required (VERSION 3.5 FATAL_ERROR)
Ed Tanous383fb7b2019-02-11 11:22:30 -08002
James Feist6579c762019-06-13 10:45:00 -07003add_definitions (-DMCTP_LOG_STDERR)
4add_definitions (-DMCTP_FILEIO)
Ed Tanous383fb7b2019-02-11 11:22:30 -08005
James Feist6579c762019-06-13 10:45:00 -07006add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
Ed Tanous383fb7b2019-02-11 11:22:30 -08007
James Feist6579c762019-06-13 10:45:00 -07008target_include_directories (libmctp PUBLIC
9 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
10 $<INSTALL_INTERFACE:include/libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080011
James Feist6579c762019-06-13 10:45:00 -070012enable_testing ()
Ed Tanous383fb7b2019-02-11 11:22:30 -080013
James Feist6579c762019-06-13 10:45:00 -070014add_executable (test_eid tests/test_eid.c tests/test-utils.c)
15target_link_libraries (test_eid libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080016
James Feist6579c762019-06-13 10:45:00 -070017add_executable (test_seq tests/test_seq.c tests/test-utils.c)
18target_link_libraries (test_seq libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080019
James Feist6579c762019-06-13 10:45:00 -070020install (TARGETS libmctp DESTINATION lib)
21install (FILES libmctp.h DESTINATION include)
22