blob: 5b576372ee32a81217d8d0b257d541166556110e [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)
James Feistcc0edda2019-12-09 15:03:25 -08004add_definitions (-DMCTP_HAVE_FILEIO)
Andrew Jeffery682232e2020-01-13 16:17:45 +10305add_definitions (-DMCTP_HAVE_STDIO)
Ed Tanous383fb7b2019-02-11 11:22:30 -08006
James Feist6579c762019-06-13 10:45:00 -07007add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
Ed Tanous383fb7b2019-02-11 11:22:30 -08008
James Feist6579c762019-06-13 10:45:00 -07009target_include_directories (libmctp PUBLIC
10 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
11 $<INSTALL_INTERFACE:include/libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080012
James Feist6579c762019-06-13 10:45:00 -070013enable_testing ()
Ed Tanous383fb7b2019-02-11 11:22:30 -080014
James Feist6579c762019-06-13 10:45:00 -070015add_executable (test_eid tests/test_eid.c tests/test-utils.c)
16target_link_libraries (test_eid libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080017
James Feist6579c762019-06-13 10:45:00 -070018add_executable (test_seq tests/test_seq.c tests/test-utils.c)
19target_link_libraries (test_seq libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080020
James Feist6579c762019-06-13 10:45:00 -070021install (TARGETS libmctp DESTINATION lib)
22install (FILES libmctp.h DESTINATION include)
23