blob: 9775628e110e36a147668209ebc040735744ad42 [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
Andrew Jeffery8e436af2020-02-28 14:33:42 +10308add_library (mctp STATIC alloc.c core.c log.c libmctp.h serial.c)
Ed Tanous383fb7b2019-02-11 11:22:30 -08009
Andrew Jeffery8e436af2020-02-28 14:33:42 +103010target_include_directories (mctp PUBLIC
James Feist6579c762019-06-13 10:45:00 -070011 $<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)
Andrew Jeffery8e436af2020-02-28 14:33:42 +103017target_link_libraries (test_eid mctp)
Andrew Jeffery56c6ff12020-02-28 14:43:42 +103018add_test (NAME eid COMMAND test_eid)
Ed Tanous383fb7b2019-02-11 11:22:30 -080019
James Feist6579c762019-06-13 10:45:00 -070020add_executable (test_seq tests/test_seq.c tests/test-utils.c)
Andrew Jeffery8e436af2020-02-28 14:33:42 +103021target_link_libraries (test_seq mctp)
Andrew Jeffery56c6ff12020-02-28 14:43:42 +103022add_test (NAME seq COMMAND test_seq)
Ed Tanous383fb7b2019-02-11 11:22:30 -080023
Andrew Jeffery8e436af2020-02-28 14:33:42 +103024install (TARGETS mctp DESTINATION lib)
James Feist6579c762019-06-13 10:45:00 -070025install (FILES libmctp.h DESTINATION include)
26