mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
FindIcotool: Add Icotool_VERSION
This deprecates the ICOTOOL_VERSION_STRING result variable. Issue: #27088
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user