27 lines
753 B
CMake
27 lines
753 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
|
|
# Point BOARD_ROOT and DTS_ROOT to the 'software' directory, which contains 'boards'.
|
|
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
|
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
project(slave_node)
|
|
|
|
# Define a variable for the lib directory
|
|
set(LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../lib)
|
|
|
|
# Add the include directories for the libraries
|
|
target_include_directories(app PRIVATE
|
|
${LIB_DIR}/valve
|
|
${LIB_DIR}/modbus_server
|
|
${LIB_DIR}/fwu
|
|
)
|
|
|
|
# Add the source files from the app and the libraries
|
|
target_sources(app PRIVATE
|
|
src/main.c
|
|
src/shell_modbus.c
|
|
src/shell_system.c
|
|
${LIB_DIR}/valve/valve.c
|
|
${LIB_DIR}/modbus_server/modbus_server.c
|
|
${LIB_DIR}/fwu/fwu.c
|
|
) |