diff --git a/Help/release/dev/find-modules.rst b/Help/release/dev/find-modules.rst index f691c74620..d4d23c0153 100644 --- a/Help/release/dev/find-modules.rst +++ b/Help/release/dev/find-modules.rst @@ -16,6 +16,9 @@ Find Modules * The :module:`FindFreetype` module now provides a ``Freetype_VERSION`` result variable. The ``FREETYPE_VERSION_STRING`` result variable is deprecated. +* The :module:`FindGettext` module now provides a ``Gettext_VERSION`` result + variable. The ``GETTEXT_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/FindGettext.cmake b/Modules/FindGettext.cmake index 71d41e0d05..49f27b7cdb 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -10,7 +10,7 @@ messages: .. code-block:: cmake - find_package(Gettext [] ...) + find_package(Gettext [] [...]) GNU gettext is a system for internationalization (i18n) and localization (l10n), consisting of command-line tools and a runtime library (``libintl``). @@ -40,7 +40,9 @@ This module defines the following variables: backward compatibility, the ``GETTEXT_FOUND`` variable is also set to the same value. -``GETTEXT_VERSION_STRING`` +``Gettext_VERSION`` + .. versionadded:: 4.2 + The version of gettext found. Cache Variables @@ -194,6 +196,17 @@ gettext is found: For better control over build and installation behavior, use :command:`gettext_process_po_files` instead. +Deprecated Variables +^^^^^^^^^^^^^^^^^^^^ + +The following variables are provided for backward compatibility: + +``GETTEXT_VERSION_STRING`` + .. deprecated:: 4.2 + Superseded by the ``Gettext_VERSION``. + + The version of gettext found. + Examples ^^^^^^^^ @@ -398,7 +411,8 @@ if(GETTEXT_MSGMERGE_EXECUTABLE) get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME) get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE) if(gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)") - set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}") + set(Gettext_VERSION "${CMAKE_MATCH_2}") + set(GETTEXT_VERSION_STRING "${Gettext_VERSION}") endif() unset(gettext_version) unset(msgmerge_name) @@ -408,7 +422,7 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Gettext REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE - VERSION_VAR GETTEXT_VERSION_STRING) + VERSION_VAR Gettext_VERSION) function(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name) set(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}") diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 38b6cbf2a5..cfc347ab7e 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -118,7 +118,7 @@ foreach( DOXYGEN EXPAT FLEX Freetype - GIF GTK2 + Gettext GIF GTK2 HDF5 Jasper JPEG LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST