Commit 9a029108 authored by Mathieu Giraud's avatar Mathieu Giraud

algo/vidjil.cpp: display git short SHA1 evaluated at compilation time

The git SHA1 was previously evaluated at runtime, from the current directory.
It was a wrong idea, especially when one has several git repositories in different directories...

Now it is evaluated at compilation time by 'create-git-version-h.sh' and stored in 'git-version.h'
parent 23827909
......@@ -8,6 +8,8 @@ LIBCORE=core/vidjil.a
BINDIR=..
CREATE_VERSION_GIT_H := $(shell ./create-git-version-h.sh)
.PHONY: all core clean forcedep
v: vidjil
......
#!/bin/sh
git log -1 --pretty=format:'#define GIT_VERSION "%h (%ci)"' --abbrev-commit > git-version.h 2> /dev/null
......@@ -56,6 +56,9 @@
// #define RELEASE_TAG "2013.04"
#include "release.h"
// GIT_VERSION should be defined in "git-version.h", created by "create-git-version-h.sh", to be used outside of releases
#include "git-version.h"
#define VIDJIL_JSON_VERSION "2014.02"
//$$ #define (mainly default options)
......@@ -573,8 +576,7 @@ int main (int argc, char **argv)
#ifdef RELEASE_TAG
cout << "# version: vidjil " << RELEASE_TAG << endl ;
#else
if (system("git log -1 --pretty=format:'# git: %h (%ci)' --abbrev-commit 2> /dev/null") == 0){}
cout << endl ;
cout << "# development version - git: " << GIT_VERSION << endl ;
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment