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 | |
Andrew Jeffery | 2cda40f | 2020-02-28 15:26:20 +1030 | [diff] [blame] | 8 | add_library (mctp STATIC alloc.c astlpc.c core.c log.c libmctp.h serial.c) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 9 | |
Andrew Jeffery | 8e436af | 2020-02-28 14:33:42 +1030 | [diff] [blame] | 10 | target_include_directories (mctp PUBLIC |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 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) |
Andrew Jeffery | 8e436af | 2020-02-28 14:33:42 +1030 | [diff] [blame] | 17 | target_link_libraries (test_eid mctp) |
Andrew Jeffery | 56c6ff1 | 2020-02-28 14:43:42 +1030 | [diff] [blame] | 18 | add_test (NAME eid COMMAND test_eid) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 19 | |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 20 | add_executable (test_seq tests/test_seq.c tests/test-utils.c) |
Andrew Jeffery | 8e436af | 2020-02-28 14:33:42 +1030 | [diff] [blame] | 21 | target_link_libraries (test_seq mctp) |
Andrew Jeffery | 56c6ff1 | 2020-02-28 14:43:42 +1030 | [diff] [blame] | 22 | add_test (NAME seq COMMAND test_seq) |
Ed Tanous | 383fb7b | 2019-02-11 11:22:30 -0800 | [diff] [blame] | 23 | |
Andrew Jeffery | 2cda40f | 2020-02-28 15:26:20 +1030 | [diff] [blame] | 24 | add_executable (test_bridge tests/test_bridge.c tests/test-utils.c) |
| 25 | target_link_libraries (test_bridge mctp) |
| 26 | add_test (NAME bridge COMMAND test_bridge) |
| 27 | |
| 28 | add_executable (test_astlpc tests/test_astlpc.c tests/test-utils.c) |
| 29 | target_link_libraries (test_astlpc mctp) |
| 30 | add_test (NAME astlpc COMMAND test_astlpc) |
| 31 | |
| 32 | add_executable (test_serial tests/test_serial.c tests/test-utils.c) |
| 33 | target_link_libraries (test_serial mctp) |
| 34 | add_test (NAME serial COMMAND test_serial) |
| 35 | |
Wiktor GoĊgowski | ba6727e | 2020-03-13 18:25:01 +0100 | [diff] [blame] | 36 | add_executable (test_cmds tests/test_cmds.c tests/test-utils.c) |
| 37 | target_link_libraries (test_cmds mctp) |
| 38 | add_test (NAME control_commands COMMAND test_cmds) |
| 39 | |
Andrew Jeffery | 8e436af | 2020-02-28 14:33:42 +1030 | [diff] [blame] | 40 | install (TARGETS mctp DESTINATION lib) |
James Feist | 6579c76 | 2019-06-13 10:45:00 -0700 | [diff] [blame] | 41 | install (FILES libmctp.h DESTINATION include) |
| 42 | |