cbfc37cde6
PROJECT_VER was only read at CMake configure time, so builds kept the previous commit's version. CMake now re-runs when .git/logs/HEAD or .git/index change. Needed for OTA tests (step 2b), which rely on the version changing between builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
804 B
CMake
21 lines
804 B
CMake
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()
|
|
|
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
|
project(aes67_p4)
|