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) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 6 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 7 | 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] | 8 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 9 | target_include_directories (libmctp PUBLIC |
| 10 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> |
| 11 | $<INSTALL_INTERFACE:include/libmctp) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 12 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 13 | enable_testing () |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 14 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 15 | add_executable (test_eid tests/test_eid.c tests/test-utils.c) |
| 16 | target_link_libraries (test_eid libmctp) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 17 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 18 | add_executable (test_seq tests/test_seq.c tests/test-utils.c) |
| 19 | target_link_libraries (test_seq libmctp) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 20 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 21 | install (TARGETS libmctp DESTINATION lib) |
| 22 | install (FILES libmctp.h DESTINATION include) |
| 23 | |