From: Angus Gratton Date: Wed, 22 May 2019 00:19:38 +0000 (+1000) Subject: cmake: Project & IDF git revisions: Show un-annotated tags and -dirty flag X-Git-Tag: v4.0-beta1~312^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95dcfecedc9a67b02c99bebe0b877fd750a4ada8;p=esp-idf cmake: Project & IDF git revisions: Show un-annotated tags and -dirty flag Adds --tags and --dirty flags to cmake git_describe() calls, and not pass the HEAD commit hash (incompatible with --dirty) Makes IDF_VER output the same as in Make build system Thanks to @william-ferguson-au for reporting this: https://github.com/espressif/esp-idf/issues/3378#event-2355460974 --- diff --git a/tools/cmake/third_party/GetGitRevisionDescription.cmake b/tools/cmake/third_party/GetGitRevisionDescription.cmake index 51468b39b3..1de63b3623 100644 --- a/tools/cmake/third_party/GetGitRevisionDescription.cmake +++ b/tools/cmake/third_party/GetGitRevisionDescription.cmake @@ -113,7 +113,8 @@ function(git_describe _var _repo_dir) ${_repo_dir} describe "--always" - ${hash} + "--tags" + "--dirty" ${ARGN} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"