diff --git a/Help/release/dev/find-modules.rst b/Help/release/dev/find-modules.rst index c95384cf7a..3cbcc7c7b9 100644 --- a/Help/release/dev/find-modules.rst +++ b/Help/release/dev/find-modules.rst @@ -34,6 +34,9 @@ Find Modules * The :module:`FindGnuTLS` module now provides a ``GnuTLS_VERSION`` result variable. The ``GNUTLS_VERSION`` result variable is deprecated. +* The :module:`FindHg` module now provides a ``Hg_VERSION`` result + variable. The ``HG_VERSION_STRING`` result variable is deprecated. + * The :module:`FindJasper` module now provides a ``Jasper_VERSION`` result variable. The ``JASPER_VERSION_STRING`` result variable is deprecated. diff --git a/Modules/ExternalProject/shared_internal_commands.cmake b/Modules/ExternalProject/shared_internal_commands.cmake index c2e5b47214..df1290ee70 100644 --- a/Modules/ExternalProject/shared_internal_commands.cmake +++ b/Modules/ExternalProject/shared_internal_commands.cmake @@ -1596,7 +1596,7 @@ function(_ep_add_update_command name) set(hg_tag "tip") endif() - if("${HG_VERSION_STRING}" STREQUAL "2.1") + if("${Hg_VERSION}" STREQUAL "2.1") set(notesAnchor "#A2.1.1:_revert_pull_return_code_change.2C_compile_issue_on_OS_X" ) diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake index f4f30743da..1c04f0b788 100644 --- a/Modules/FindHg.cmake +++ b/Modules/FindHg.cmake @@ -22,7 +22,9 @@ This module defines the following variables: found. For backward compatibility, the ``HG_FOUND`` variable is also set to the same value. -``HG_VERSION_STRING`` +``Hg_VERSION`` + .. versionadded:: 4.2 + The version of Mercurial found. Cache Variables @@ -58,6 +60,15 @@ found: ``_WC_REVISION`` Current revision. +Deprecated Variables +^^^^^^^^^^^^^^^^^^^^ + +The following variables are provided for backward compatibility: + +``HG_VERSION_STRING`` + .. deprecated:: 4.2 + Use ``Hg_VERSION``, which has the same value. + Examples ^^^^^^^^ @@ -103,7 +114,8 @@ if(HG_EXECUTABLE) set_property(CACHE HG_EXECUTABLE PROPERTY VALUE "HG_EXECUTABLE-NOTFOUND") endif() if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)") - set(HG_VERSION_STRING "${CMAKE_MATCH_1}") + set(Hg_VERSION "${CMAKE_MATCH_1}") + set(HG_VERSION_STRING "${Hg_VERSION}") endif() unset(hg_version) @@ -126,4 +138,4 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Hg REQUIRED_VARS HG_EXECUTABLE - VERSION_VAR HG_VERSION_STRING) + VERSION_VAR Hg_VERSION) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index a95fc982b2..c6c032aea2 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -119,7 +119,7 @@ foreach( EXPAT FLEX Freetype Gettext GIF GnuTLS GNUTLS GTK2 - HDF5 + HDF5 Hg Jasper JPEG LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST OpenSceneGraph OPENSCENEGRAPH OpenSSL OPENSSL diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 12081522ac..b1ce43a215 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -595,7 +595,7 @@ if(EP_TEST_HG) # # Mercurial 2.1 does not distinguish an empty pull from a failed pull, # so do not run the test with that version. - if(NOT "${HG_VERSION_STRING}" STREQUAL "2.1") + if(NOT Hg_VERSION STREQUAL "2.1") set(proj TutorialStep1-HG-tip) ExternalProject_Add(${proj} HG_REPOSITORY "${local_hg_repo}"