blob: f3f05bdf6ad507085d5f9982f35a2b66a12b9761 [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)
James Feist9c99af22020-01-28 11:45:34 -08006add_definitions (-DMCTP_DEFAULT_ALLOC)
Ed Tanous383fb7b2019-02-11 11:22:30 -08007
James Feist6579c762019-06-13 10:45:00 -07008add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c)
Ed Tanous383fb7b2019-02-11 11:22:30 -08009
James Feist6579c762019-06-13 10:45:00 -070010target_include_directories (libmctp PUBLIC
11 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
12 $<INSTALL_INTERFACE:include/libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080013
James Feist6579c762019-06-13 10:45:00 -070014enable_testing ()
Ed Tanous383fb7b2019-02-11 11:22:30 -080015
James Feist6579c762019-06-13 10:45:00 -070016add_executable (test_eid tests/test_eid.c tests/test-utils.c)
17target_link_libraries (test_eid libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080018
James Feist6579c762019-06-13 10:45:00 -070019add_executable (test_seq tests/test_seq.c tests/test-utils.c)
20target_link_libraries (test_seq libmctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080021
James Feist6579c762019-06-13 10:45:00 -070022install (TARGETS libmctp DESTINATION lib)
23install (FILES libmctp.h DESTINATION include)
24