diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e50d9c..2cae49d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,11 @@ 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. Re-run cmake (idf.py reconfigure) to pick up a new tag. +# 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}