From 4ec9aa9a00adf61aa9e4324cb1fa0ff4aa20bc33 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Fri, 14 Sep 2018 17:02:37 +0530 Subject: [PATCH] cmake: prefer `version.txt` for IDF_VER if available --- tools/cmake/idf_functions.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/cmake/idf_functions.cmake b/tools/cmake/idf_functions.cmake index 8f22ea28b..d68eabf62 100644 --- a/tools/cmake/idf_functions.cmake +++ b/tools/cmake/idf_functions.cmake @@ -213,7 +213,11 @@ endfunction() # Running git_describe() here automatically triggers rebuilds # if the ESP-IDF git version changes function(idf_get_git_revision) - git_describe(IDF_VER "${IDF_PATH}") + if(EXISTS "${IDF_PATH}/version.txt") + file(STRINGS "${IDF_PATH}/version.txt" IDF_VER) + else() + git_describe(IDF_VER "${IDF_PATH}") + endif() add_definitions(-DIDF_VER=\"${IDF_VER}\") git_submodule_check("${IDF_PATH}") set(IDF_VER ${IDF_VER} PARENT_SCOPE)