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)
