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

index 06fd0b4..e53759c 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 142255d..4ad3b3d 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 980529e..edffa55 100644 (file)
--- a/client.h
+++ b/client.h
@@ -232,6 +232,8 @@ private:
        QHistoryState *connectedHistoryState;
 };
 
+ANIDBUDPCLIENTSHARED_EXPORT char *revision();
+
 } // namespace AniDBUdpClient
 
 #include <QScriptEngine>