- non-release builds now display git revision info if available. This turned out to be much simpler to implement than I expected..

Thu, 19 Dec 2013 16:08:05 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Thu, 19 Dec 2013 16:08:05 +0200
changeset 573
74d71c6fdc20
parent 572
5a08d67ed770
child 574
10874674fe30

- non-release builds now display git revision info if available. This turned out to be much simpler to implement than I expected..

ldforge.pro file | annotate | diff | comparison | revisions
src/main.cc file | annotate | diff | comparison | revisions
--- a/ldforge.pro	Thu Dec 19 16:01:29 2013 +0200
+++ b/ldforge.pro	Thu Dec 19 16:08:05 2013 +0200
@@ -32,6 +32,8 @@
 	OBJECTS_DIR = ./build_release/
 }
 
+exists(.git): DEFINES += GIT_DESCRIBE="\\\"$$system(git describe --tags)\\\""
+
 unix {
 	LIBS += -lGLU
 }
--- a/src/main.cc	Thu Dec 19 16:01:29 2013 +0200
+++ b/src/main.cc	Thu Dec 19 16:08:05 2013 +0200
@@ -118,5 +118,10 @@
 // =============================================================================
 // -----------------------------------------------------------------------------
 QString fullVersionString()
-{	return "v" + versionString();
+{
+#if BUILD_ID != BUILD_RELEASE && defined (GIT_DESCRIBE)
+	return GIT_DESCRIBE;
+#else
+	return "v" + versionString();
+#endif
 }
\ No newline at end of file

mercurial