blackmagic-esp32-s2/main/CMakeLists.txt

79 lines
1.9 KiB
CMake
Raw Normal View History

set(SOURCES
2021-10-14 09:04:00 +01:00
"main.c"
"usb.c"
"usb-uart.c"
2021-10-14 09:30:43 +01:00
"nvs.c"
"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"
"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"
"factory-reset-service.c"
2021-10-14 09:04:00 +01:00
)
set(INCLUDES
2021-10-14 09:04:00 +01:00
"."
)
idf_component_register(SRCS ${SOURCES}
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")
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}")
set_property(SOURCE "cli/cli-commands-device-info.c" APPEND PROPERTY COMPILE_OPTIONS ${INFO_FLAGS})