diff --git a/Help/release/dev/find-modules.rst b/Help/release/dev/find-modules.rst index d15ea86b4e..7350b70bc2 100644 --- a/Help/release/dev/find-modules.rst +++ b/Help/release/dev/find-modules.rst @@ -40,6 +40,9 @@ Find Modules * The :module:`FindHSPELL` module now provides a ``HSPELL_VERSION`` result variable. The ``HSPELL_VERSION_STRING`` result variable is deprecated. +* The :module:`FindIcotool` module now provides a ``Icotool_VERSION`` result + variable. The ``ICOTOOL_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/FindIcotool.cmake b/Modules/FindIcotool.cmake index 1009c756bd..2e28642b59 100644 --- a/Modules/FindIcotool.cmake +++ b/Modules/FindIcotool.cmake @@ -18,9 +18,13 @@ Result Variables This module defines the following variables: ``Icotool_FOUND`` - True if ``icotool`` has been found. For backward compatibility, the - ``ICOTOOL_FOUND`` variable is also set to the same value. -``ICOTOOL_VERSION_STRING`` + Boolean indicating whether (the requested version of) ``icotool`` has been + found. For backward compatibility, the ``ICOTOOL_FOUND`` variable is also + set to the same value. + +``Icotool_VERSION`` + .. versionadded:: 4.2 + The version of ``icotool`` found. Cache Variables @@ -31,6 +35,17 @@ The following cache variables may also be set: ``ICOTOOL_EXECUTABLE`` The full path to the ``icotool`` tool. +Deprecated Variables +^^^^^^^^^^^^^^^^^^^^ + +The following variables are provided for backward compatibility: + +``ICOTOOL_VERSION_STRING`` + .. deprecated:: 4.2 + Use ``Icotool_VERSION``, which has the same value. + + The version of ``icotool`` found. + Examples ^^^^^^^^ @@ -55,27 +70,23 @@ find_program(ICOTOOL_EXECUTABLE if(ICOTOOL_EXECUTABLE) execute_process( COMMAND ${ICOTOOL_EXECUTABLE} --version - OUTPUT_VARIABLE _icotool_version + OUTPUT_VARIABLE Icotool_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) - if("${_icotool_version}" MATCHES "^icotool \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)") - set( ICOTOOL_VERSION_STRING - "${CMAKE_MATCH_1}" - ) + if("${Icotool_VERSION}" MATCHES "^icotool \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)") + set(Icotool_VERSION "${CMAKE_MATCH_1}") else() - set( ICOTOOL_VERSION_STRING - "" - ) + set(Icotool_VERSION "") endif() - unset(_icotool_version) + set(ICOTOOL_VERSION_STRING "${Icotool_VERSION}") endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args( Icotool REQUIRED_VARS ICOTOOL_EXECUTABLE - VERSION_VAR ICOTOOL_VERSION_STRING + VERSION_VAR Icotool_VERSION ) mark_as_advanced( diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index f909556af1..4bdf354683 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -121,6 +121,7 @@ foreach( FLEX Freetype Gettext GIF GnuTLS GNUTLS GTK2 HDF5 Hg HSPELL + Icotool Jasper JPEG LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST OpenSceneGraph OPENSCENEGRAPH OpenSSL OPENSSL