blob: 2cdb75769fa6ed7b7e915597702aac7f754b5fb2 [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)
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)
Andrew Jeffery8e436af2020-02-28 14:33:42 +103020target_link_libraries (test_seq mctp)
Ed Tanous383fb7b2019-02-11 11:22:30 -080021
Andrew Jeffery8e436af2020-02-28 14:33:42 +103022install (TARGETS mctp DESTINATION lib)
James Feist6579c762019-06-13 10:45:00 -070023install (FILES libmctp.h DESTINATION include)
24