FindHSPELL: Add HSPELL_VERSION

This deprecates the HSPELL_VERSION_STRING result variable.

Additionally, fixed typos:
* HSPELL_VERSION_MAJOR
* HSPELL_VERSION_MINOR

Issue: #27088
This commit is contained in:
Peter Kokot
2025-08-20 22:59:52 +02:00
parent 9e89400d13
commit f503c8dad4
3 changed files with 30 additions and 9 deletions

View File

@@ -37,6 +37,9 @@ Find Modules
* The :module:`FindHg` module now provides a ``Hg_VERSION`` result
variable. The ``HG_VERSION_STRING`` result variable is deprecated.
* The :module:`FindHSPELL` module now provides a ``HSPELL_VERSION`` result
variable. The ``HSPELL_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.

View File

@@ -17,13 +17,18 @@ Result Variables
This module defines the following variables:
``HSPELL_FOUND``
Boolean indicating whether the Hspell is found.
``HSPELL_VERSION_STRING``
Boolean indicating whether (the requested version of) Hspell is found.
``HSPELL_VERSION``
.. versionadded:: 4.2
The version of Hspell found (x.y).
``HSPELL_MAJOR_VERSION``
The major version of Hspell.
``HSPELL_MINOR_VERSION``
The minor version of Hspell.
``HSPELL_VERSION_MAJOR``
The major version of Hspell found.
``HSPELL_VERSION_MINOR``
The minor version of Hspell found.
Cache Variables
^^^^^^^^^^^^^^^
@@ -32,9 +37,21 @@ The following cache variables may also be set:
``HSPELL_INCLUDE_DIR``
The Hspell include directory.
``HSPELL_LIBRARIES``
The libraries needed to use Hspell.
Deprecated Variables
^^^^^^^^^^^^^^^^^^^^
The following variables are provided for backward compatibility:
``HSPELL_VERSION_STRING``
.. deprecated:: 4.2
Use ``HSPELL_VERSION``, which has the same value.
The version of Hspell found (x.y).
Examples
^^^^^^^^
@@ -56,14 +73,15 @@ if (HSPELL_INCLUDE_DIR)
file(STRINGS "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H REGEX "#define HSPELL_VERSION_M(AJO|INO)R [0-9]+")
string(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
string(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
set(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
set(HSPELL_VERSION "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
set(HSPELL_VERSION_STRING "${HSPELL_VERSION}")
unset(HSPELL_H)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HSPELL
REQUIRED_VARS HSPELL_LIBRARIES HSPELL_INCLUDE_DIR
VERSION_VAR HSPELL_VERSION_STRING)
VERSION_VAR HSPELL_VERSION)
mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)

View File

@@ -120,7 +120,7 @@ foreach(
EXPAT
FLEX Freetype
Gettext GIF GnuTLS GNUTLS GTK2
HDF5 Hg
HDF5 Hg HSPELL
Jasper JPEG
LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST
OpenSceneGraph OPENSCENEGRAPH OpenSSL OPENSSL