cmake_minimum_required(VERSION 2.6)

project(${proto.utilName})

include_directories("MrT/Modules")
include_directories("src")
include_directories("src/lib")

add_definitions(
    -g
    -DMRT_PLATFORM=MRT_PLATFORM_NONE
    -DPOLY_PACKET_DEBUG_LVL=1
    )

#SET(CMAKE_C_FLAGS "-fsanitize=address -fsanitize=undefined")

SET(CMAKE_C_FLAGS "-Wformat=0")

add_subdirectory(MrT/Modules/Utilities/JSON)
add_subdirectory(MrT/Modules/Utilities/COBS)
add_subdirectory(MrT/Modules/Utilities/PolyPacket)
add_subdirectory(MrT/Modules/Platforms/Linux)


add_library(
  ${proto.fileName}_lib
  src/lib/${proto.fileName}.c
  )


add_executable(
  ${proto.utilName}
  src/main.c
  src/app_${proto.name.lower()}.c
  )

target_link_libraries(${proto.fileName}_lib libPolyPacket libMRT-Linux)

target_link_libraries(${proto.utilName} ${proto.fileName}_lib readline pthread)
