Firmware version from version.txt (0.9.0) instead of git describe

The version is now set by hand in version.txt, so it's readable and only
changes on purpose. git describe gave commit hashes, and always "-dirty"
because the build applies patches to the cspot submodule. Editing the file
is enough; the next build picks it up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 07:41:53 +10:00
parent 05f4ce45c3
commit 1d613b16c1
6 changed files with 15 additions and 18 deletions
+4 -15
View File
@@ -1,20 +1,9 @@
cmake_minimum_required(VERSION 3.16)
# Firmware version = git describe (tags, dirty flag). Reported by esp_app_get_description()
# and in status.fw / GET /api/ota. CMake re-runs when git's HEAD log or index changes (commit,
# checkout, add), so the version follows. A new tag or unstaged edits need `idf.py reconfigure`.
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
${CMAKE_CURRENT_LIST_DIR}/.git/logs/HEAD
${CMAKE_CURRENT_LIST_DIR}/.git/index)
execute_process(
COMMAND git describe --tags --always --dirty
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE PROJECT_VER
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(NOT PROJECT_VER)
set(PROJECT_VER "0.0.0-nogit")
endif()
# Firmware version = the first line of version.txt (edit it to release a new version). Reported by
# esp_app_get_description() and in status.fw / GET /api/ota. Editing the file re-runs CMake.
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/version.txt)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/version.txt PROJECT_VER LIMIT_COUNT 1)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(aes67_p4)