2023-02-09 14:57:03 +00:00
|
|
|
set(SOURCES
|
2021-10-14 09:04:00 +01:00
|
|
|
"main.c"
|
2023-02-09 14:57:03 +00:00
|
|
|
"usb.c"
|
2021-12-20 12:15:35 +00:00
|
|
|
"usb-uart.c"
|
2021-10-14 09:30:43 +01:00
|
|
|
"nvs.c"
|
2021-12-06 15:41:33 +00:00
|
|
|
"nvs-config.c"
|
2021-10-24 20:22:24 +01:00
|
|
|
"led.c"
|
2021-12-01 04:15:45 +00:00
|
|
|
"cli-uart.c"
|
2021-10-26 10:37:49 +01:00
|
|
|
"i2c.c"
|
2021-11-19 19:14:52 +00:00
|
|
|
"delay.c"
|
2021-11-22 11:24:16 +00:00
|
|
|
"network.c"
|
|
|
|
"network-http.c"
|
2021-11-30 04:38:57 +00:00
|
|
|
"network-gdb.c"
|
2021-12-01 04:15:45 +00:00
|
|
|
"cli-uart.c"
|
2021-12-20 12:15:35 +00:00
|
|
|
"cli/cli.c"
|
|
|
|
"cli/cli-commands.c"
|
|
|
|
"cli/cli-commands-gpio.c"
|
|
|
|
"cli/cli-commands-wifi.c"
|
|
|
|
"cli/cli-commands-config.c"
|
|
|
|
"cli/cli-commands-device-info.c"
|
|
|
|
"cli/cli-args.c"
|
|
|
|
"soft-uart-log.c"
|
2022-02-24 14:03:17 +00:00
|
|
|
"factory-reset-service.c"
|
2021-10-14 09:04:00 +01:00
|
|
|
)
|
|
|
|
|
2023-02-09 14:57:03 +00:00
|
|
|
set(INCLUDES
|
2021-10-14 09:04:00 +01:00
|
|
|
"."
|
|
|
|
)
|
|
|
|
|
|
|
|
idf_component_register(SRCS ${SOURCES}
|
2023-02-09 14:57:03 +00:00
|
|
|
INCLUDE_DIRS ${INCLUDES})
|
2021-12-02 07:28:01 +00:00
|
|
|
|
|
|
|
# Commit
|
|
|
|
execute_process(
|
|
|
|
COMMAND git rev-parse --short HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE FW_GIT_COMMIT
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
|
|
|
# Branch
|
|
|
|
execute_process(
|
|
|
|
COMMAND git rev-parse --abbrev-ref HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE FW_GIT_BRANCH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
|
|
|
# Branch number
|
|
|
|
execute_process(
|
|
|
|
COMMAND git rev-list --count HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE FW_GIT_BRANCH_NUM
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
|
|
|
# Version
|
|
|
|
execute_process(
|
|
|
|
COMMAND git describe --tags --abbrev=0
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE FW_GIT_VERSION
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
|
|
|
# Build date
|
|
|
|
string(TIMESTAMP FW_BUILD_DATE "%d-%m-%Y")
|
|
|
|
|
2021-12-12 15:56:50 +00:00
|
|
|
set(INFO_FLAGS
|
|
|
|
-DFW_BUILD_DATE="${FW_BUILD_DATE}"
|
|
|
|
-DFW_GIT_COMMIT="${FW_GIT_COMMIT}"
|
|
|
|
-DFW_GIT_BRANCH="${FW_GIT_BRANCH}"
|
|
|
|
-DFW_GIT_BRANCH_NUM="${FW_GIT_BRANCH_NUM}"
|
|
|
|
-DFW_GIT_VERSION="${FW_GIT_VERSION}"
|
|
|
|
)
|
|
|
|
|
2021-12-02 14:25:12 +00:00
|
|
|
message(STATUS "IDF version: ${IDF_VER}")
|
2021-12-02 07:28:01 +00:00
|
|
|
message(STATUS "FW date: ${FW_BUILD_DATE}")
|
|
|
|
message(STATUS "FW commit: ${FW_GIT_COMMIT}")
|
|
|
|
message(STATUS "FW branch: ${FW_GIT_BRANCH}")
|
|
|
|
message(STATUS "FW branch num: ${FW_GIT_BRANCH_NUM}")
|
|
|
|
message(STATUS "FW version: ${FW_GIT_VERSION}")
|
|
|
|
|
2021-12-20 12:15:35 +00:00
|
|
|
set_property(SOURCE "cli/cli-commands-device-info.c" APPEND PROPERTY COMPILE_OPTIONS ${INFO_FLAGS})
|