]> Some of my projects - anidbudpclient.git/commitdiff
Add revision info.
authorAPTX <marek321@gmail.com>
Thu, 12 Jan 2012 15:16:00 +0000 (16:16 +0100)
committerAPTX <marek321@gmail.com>
Thu, 12 Jan 2012 15:16:00 +0000 (16:16 +0100)
anidbudpclient.pro
client.cpp
client.h

index 06fd0b42d61452d47fa295203ec58050a7bd0b10..e53759cc7b35b9d63239db35d7ec216693b6e1de 100644 (file)
@@ -151,6 +151,9 @@ norenameparser {
        message(Disabled renameparser support)
 }
 
+REV = $$system(git show-ref -s --verify refs/heads/master)
+DEFINES += REVISION=\"$${REV}\"
+
 target.path = $${PREFIX}/lib
 
 headers.path = $${PREFIX}/include/AniDBUdpClient
index 142255d4e430137965502017da44b6676ea872c9..4ad3b3df18716359062fc3e2239bde475b913a3f 100644 (file)
@@ -1164,4 +1164,17 @@ Client *Client::m_instance = 0;
 const int Client::UDP_API_COMMAND_TIMEOUT;
 #endif
 
+ANIDBUDPCLIENTSHARED_EXPORT char *revision()
+{
+#ifdef REVISION
+#define ANI_GET_REV_I(X) #X
+#define ANI_GET_REV(X) ANI_GET_REV_I(X)
+       return ANI_GET_REV(REVISION);
+#undef ANI_GET_REV_I
+#undef ANI_GET_REV
+#else
+       return 0;
+#endif
+}
+
 } // namespace AniDBUdpClient
index 980529e20080378bd2cef23063ade134f656c7d3..edffa55ee226a35ba40df158d2b2cbcaf42353e3 100644 (file)
--- a/client.h
+++ b/client.h
@@ -232,6 +232,8 @@ private:
        QHistoryState *connectedHistoryState;
 };
 
+ANIDBUDPCLIENTSHARED_EXPORT char *revision();
+
 } // namespace AniDBUdpClient
 
 #include <QScriptEngine>