From 051b670e51bb5ee9e36407e6f81a1eef97f09b54 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 8 Aug 2025 22:08:57 +0200 Subject: [PATCH] FindSubversion: Add Subversion_VERSION This deprecates the Subversion_VERSION_SVN result variable. Issue: #27088 --- Help/release/dev/find-modules.rst | 4 ++++ Modules/FindSubversion.cmake | 23 +++++++++++++++++-- Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 1 + Tests/ExternalProject/CMakeLists.txt | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Help/release/dev/find-modules.rst b/Help/release/dev/find-modules.rst index 80f548a793..670b49a585 100644 --- a/Help/release/dev/find-modules.rst +++ b/Help/release/dev/find-modules.rst @@ -71,5 +71,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. diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index ae17656ee1..47e775f84b 100644 --- a/Modules/FindSubversion.cmake +++ b/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 ````. +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}) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 566282ec0e..41722e186d 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/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) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 12081522ac..c6f0fa305c 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/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()