[CMake] Patch for FindSubversion: fixes documentation and sets missing variable

Marcel Loose loose at astron.nl
Tue Jan 26 04:19:54 EST 2010


Hi all,

Here's a small patch that fixes two errors in the current
FindSubversion.cmake file.

1) The variable <var-prefix>_WC_ROOT was documented, but not set. This
has been fixed.

2) The documentation doesn't mention the existence of a second macro
Subversion_WC_LOG, and erroneously mentions that Subversion_WC_INFO sets
the variable <var-prefix>_WC_LAST_CHANGED_LOG. This variable is called
<var-prefix>_LAST_CHANGED_LOG and is set by Subversion_WC_LOG.

Index: FindSubversion.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindSubversion.cmake,v
retrieving revision 1.5
diff -u -r1.5 FindSubversion.cmake
--- FindSubversion.cmake        28 Sep 2009 15:45:46 -0000      1.5
+++ FindSubversion.cmake        26 Jan 2010 09:06:31 -0000
@@ -3,18 +3,21 @@
 #  Subversion_SVN_EXECUTABLE - path to svn command line client
 #  Subversion_VERSION_SVN - version of svn command line client
 #  Subversion_FOUND - true if the command line client was found
-# If the command line client executable is found the macro
+# If the command line client executable is found two macros are
defined:
 #  Subversion_WC_INFO(<dir> <var-prefix>)
-# is defined to extract information of a subversion working copy at
-# a given location. The macro defines the following variables:
+# extracts information of a subversion working copy at a given
location.
+# This macro defines the following variables:
 #  <var-prefix>_WC_URL - url of the repository (at <dir>)
 #  <var-prefix>_WC_ROOT - root url of the repository
 #  <var-prefix>_WC_REVISION - current revision
 #  <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
 #  <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
 #  <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
-#  <var-prefix>_WC_LAST_CHANGED_LOG - last log of base revision
 #  <var-prefix>_WC_INFO - output of command `svn info <dir>'
+#  Subversion_WC_LOG(<dir> <var-prefix>)
+# retrieves the log message of the base revision of a subversion
working
+# copy at a given location. This macro defines the variable:
+#  <var-prefix>_LAST_CHANGED_LOG - last log of base revision
 # Example usage:
 #  FIND_PACKAGE(Subversion)
 #  IF(Subversion_FOUND)
@@ -74,6 +77,8 @@
         "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
       STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
         "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
+      STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+        "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
       STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
         "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
       STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"




More information about the CMake mailing list