diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-07-30 12:59:58 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-07-30 12:59:58 (GMT) |
commit | 3c47ea4ff918a63eb3a3e5f67354b6975c839743 (patch) | |
tree | dccdf5b5583256944297866d990b165b5f504c82 /libversion/gitversion.cpp.in | |
parent | 869602993d389ae85994aae17db26940cc44f0cf (diff) | |
parent | cb1ef441b2a4d21cf67a59fe8e57613ba3552051 (diff) | |
download | Doxygen-3c47ea4ff918a63eb3a3e5f67354b6975c839743.zip Doxygen-3c47ea4ff918a63eb3a3e5f67354b6975c839743.tar.gz Doxygen-3c47ea4ff918a63eb3a3e5f67354b6975c839743.tar.bz2 |
Merge branch 'feature/bug_gitversion' of https://github.com/albert-github/doxygen into albert-github-feature/bug_gitversion
Diffstat (limited to 'libversion/gitversion.cpp.in')
-rw-r--r-- | libversion/gitversion.cpp.in | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libversion/gitversion.cpp.in b/libversion/gitversion.cpp.in new file mode 100644 index 0000000..164b50b --- /dev/null +++ b/libversion/gitversion.cpp.in @@ -0,0 +1,16 @@ +#include <string.h> +#include <version.h> + +/* - On some systems git is not installed or + * installed on a place where FindGit.cmake cannot find it + * - No git information is present (no .git directory) + * in those cases clear the gitVersionString (would have string GIT-NOTFOUND). + */ +char *getGitVersion(void) +{ + static char gitVersionString[100]; + strcpy(gitVersionString,"@GIT_HEAD_SHA1@"); + strcat(gitVersionString,!strcmp("@GIT_IS_DIRTY@","true")?"*":""); + if (!strcmp("@GIT_HEAD_SHA1@", "GIT-NOTFOUND")) gitVersionString[0] = '\0'; + return gitVersionString; +} |