include the svn revision in the --version info (wish 162179)
Jaime
jtamate at gmail.com
Mon Nov 17 11:41:14 GMT 2008
Hello,
I have a patch for CMakeList.txt in kdelibs to solve my own wish (include
the svn revision in the --version info)
http://bugs.kde.org/show_bug.cgi?id=162179
--- CMakeLists.txt 2008-11-17 12:29:41.765625000 +0100
+++ CMakeLists.txt 2008-11-17 10:06:49.000000000
+0100
@@ -8,9 +8,29
@@
set (KDE_VERSION_MAJOR
4)
set (KDE_VERSION_MINOR
1)
set (KDE_VERSION_RELEASE
73)
set (KDE_VERSION
"${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" )
-set (KDE_VERSION_STRING "${KDE_VERSION} (KDE 4.1.73 (KDE 4.2 >=
20081112))")
+
+execute_process(COMMAND svn info --xml WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND grep -m 1
revision
+ COMMAND cut -f 2 -d
\"
+ OUTPUT_VARIABLE SVN_REVISION
)
+if (SVN_REVISION)
+ string(STRIP ${SVN_REVISION} SVN_REVISION)
+ set(SVN_REVISION "r${SVN_REVISION}")
+else(SVN_REVISION)
+ set (SVN_REVISION "${KDE_VERSION}")
+endif(SVN_REVISION)
+
+set (KDE_VERSION_STRING "${KDE_VERSION} (${SVN_REVISION} (KDE 4.2 >=
20081112))")
With this patch, if the svn info is not available, the KDE_VERSION_STRING
remains unaltered.
Can this still be applied in trunk or have to wait to 4.3?
Best Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081117/d1299309/attachment.htm>
More information about the kde-core-devel
mailing list