build: add cmake support

feat: add cmake support

chore: remove old code

revert: remove mbus_data_record_unit

build: do not break existing building system
This commit is contained in:
Carlos Gomes Martinho
2020-03-17 21:25:08 +01:00
parent 62ac3678ff
commit d96dcfad09
8 changed files with 279 additions and 21 deletions

19
bin/CMakeLists.txt Normal file
View File

@ -0,0 +1,19 @@
function(add_example SRCS)
add_executable(${SRCS} ${CMAKE_CURRENT_LIST_DIR}/${SRCS}.c)
target_link_libraries(${SRCS} PRIVATE libmbus::libmbus)
endfunction()
add_example(mbus-serial-request-data)
add_example(mbus-serial-request-data-multi-reply)
add_example(mbus-serial-scan)
add_example(mbus-serial-scan-secondary)
add_example(mbus-serial-select-secondary)
add_example(mbus-serial-set-address)
add_example(mbus-serial-switch-baudrate)
add_example(mbus-tcp-application-reset)
add_example(mbus-tcp-raw-send)
add_example(mbus-tcp-request-data)
add_example(mbus-tcp-request-data-multi-reply)
add_example(mbus-tcp-scan)
add_example(mbus-tcp-scan-secondary)
add_example(mbus-tcp-select-secondary)