James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.5 FATAL_ERROR) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 2 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 3 | add_definitions (-DMCTP_LOG_STDERR) |
James Feist | cc0edda | 2019-12-09 15:03:25 -0800 | [diff] [blame] | 4 | add_definitions (-DMCTP_HAVE_FILEIO) |
Andrew Jeffery | 682232e | 2020-01-13 16:17:45 +1030 | [diff] [blame] | 5 | add_definitions (-DMCTP_HAVE_STDIO) |
James Feist | 9c99af2 | 2020-01-28 11:45:34 -0800 | [diff] [blame] | 6 | add_definitions (-DMCTP_DEFAULT_ALLOC) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 7 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 8 | add_library (libmctp STATIC alloc.c core.c log.c libmctp.h serial.c) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 9 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 10 | target_include_directories (libmctp PUBLIC |
| 11 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> |
| 12 | $<INSTALL_INTERFACE:include/libmctp) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 13 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 14 | enable_testing () |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 15 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 16 | add_executable (test_eid tests/test_eid.c tests/test-utils.c) |
| 17 | target_link_libraries (test_eid libmctp) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 18 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 19 | add_executable (test_seq tests/test_seq.c tests/test-utils.c) |
| 20 | target_link_libraries (test_seq libmctp) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 21 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 22 | install (TARGETS libmctp DESTINATION lib) |
| 23 | install (FILES libmctp.h DESTINATION include) |
| 24 | |