Browse Source

Merge topic 'patch-FindSubversion-version'

051b670e51 FindSubversion: Add Subversion_VERSION

Acked-by: Kitware Robot <[email protected]>
Merge-request: !11053
Brad King 3 months ago
parent
commit
0aec7864f6

+ 4 - 0
Help/release/dev/find-modules.rst

@@ -88,5 +88,9 @@ Find Modules
   ``SQUISH_VERSION_MINOR``, and ``SQUISH_VERSION_PATCH`` result variables
   are deprecated.
 
+* The :module:`FindSubversion` module now provides a ``Subversion_VERSION``
+  result variable.  The ``Subversion_VERSION_SVN`` result variable is
+  deprecated.
+
 * The :module:`FindTIFF` module now provides a ``TIFF_VERSION`` result
   variable.  The ``TIFF_VERSION_STRING`` result variable is deprecated.

+ 21 - 2
Modules/FindSubversion.cmake

@@ -22,7 +22,9 @@ This module defines the following variables:
   client is found.  For backward compatibility, the ``SUBVERSION_FOUND``
   variable is also set to the same value.
 
-``Subversion_VERSION_SVN``
+``Subversion_VERSION``
+  .. versionadded:: 4.2
+
   Version of the ``svn`` command-line client found.
 
 Cache Variables
@@ -93,6 +95,17 @@ client is found:
     Last log of the base revision of a Subversion working copy located at
     ``<dir>``.
 
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
+
+The following variables are provided for backward compatibility:
+
+``Subversion_VERSION_SVN``
+  .. deprecated:: 4.2
+    Use the ``Subversion_VERSION``.
+
+  Version of the ``svn`` command-line client found.
+
 Examples
 ^^^^^^^^
 
@@ -166,6 +179,12 @@ if(Subversion_SVN_EXECUTABLE)
     endif()
   endif()
 
+  if(DEFINED Subversion_VERSION_SVN)
+    set(Subversion_VERSION "${Subversion_VERSION_SVN}")
+  else()
+    unset(Subversion_VERSION)
+  endif()
+
   macro(Subversion_WC_INFO dir prefix)
 
     cmake_parse_arguments(
@@ -229,7 +248,7 @@ endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
-                                             VERSION_VAR Subversion_VERSION_SVN )
+                                             VERSION_VAR Subversion_VERSION)
 
 # for compatibility
 set(Subversion_SVN_FOUND ${Subversion_FOUND})

+ 1 - 0
Tests/CMakeOnly/AllFindModules/CMakeLists.txt

@@ -133,4 +133,5 @@ foreach(
 endforeach()
 
 check_version_string(PYTHONINTERP PYTHON_VERSION_STRING)
+check_version_string(SUBVERSION Subversion_VERSION)
 check_version_string(SUBVERSION Subversion_VERSION_SVN)

+ 1 - 1
Tests/ExternalProject/CMakeLists.txt

@@ -17,7 +17,7 @@ endif()
 
 if(NOT DEFINED EP_TEST_SVN OR EP_TEST_SVN)
   find_package(Subversion)
-  if(Subversion_FOUND AND Subversion_VERSION_SVN VERSION_LESS 1.2)
+  if(Subversion_FOUND AND Subversion_VERSION VERSION_LESS 1.2)
     message(STATUS "No ExternalProject svn tests with svn client less than version 1.2")
     set(Subversion_FOUND 0)
   endif()