cmake_minimum_required(VERSION 3.20.0)

# Set BOARD_ROOT and DTS_ROOT to the repo root so that boards/<vendor>/<board>/
# is searched for out-of-tree board definitions.
# Must be set BEFORE find_package(Zephyr).
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR}/..)
list(APPEND DTS_ROOT   ${CMAKE_CURRENT_LIST_DIR}/..)

# LR11xx out-of-tree driver is currently not added as a Zephyr module
# to avoid Kconfig dependency issues during board prototyping.
# If needed, re-enable by appending the driver path to ZEPHYR_EXTRA_MODULES.
list(APPEND ZEPHYR_EXTRA_MODULES
  ${CMAKE_CURRENT_LIST_DIR}/../drivers/lora/lr11xx
)


find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(loramodem LANGUAGES C)

target_sources(app PRIVATE
  src/main.c
  src/kiss.c
  src/lora_modem.c
)

target_include_directories(app PRIVATE src)
