mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 02:10:10 -06:00
This marks all `<PACKAGENAME>_FOUND` result variables as deprecated where possible (for `<PackageName>` find modules) to make it clearer which variable to use. In CMake 3.3, the FindPackageHandleStandardArgs module was refactored to set both `<PackageName>_FOUND` and uppercase `<PACKAGENAME>_FOUND` result variables to the same values. Before that, the FOUND_VAR argument could be used to set the result variable. * FindMatlab: Uppercased MATLAB_FOUND is not mentioned as it was never documented. * Documentation for FindPythonInterp and FindPythonLibs modules synced accordingly to their deprecation (3.12 instead of 4.2). * OPENGL_FOUND: deprecation version synced with other find modules. * DevIL_FOUND was introduced in CMake 3.8. The uppercased variant not mentioned as it was previously never documented. Fixes: #27242
89 lines
2.3 KiB
CMake
89 lines
2.3 KiB
CMake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
# file LICENSE.rst or https://cmake.org/licensing for details.
|
|
|
|
#[=======================================================================[.rst:
|
|
FindHSPELL
|
|
----------
|
|
|
|
Finds the Hebrew spell-checker and morphology engine (Hspell):
|
|
|
|
.. code-block:: cmake
|
|
|
|
find_package(HSPELL [<version>] [...])
|
|
|
|
Result Variables
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
This module defines the following variables:
|
|
|
|
``HSPELL_FOUND``
|
|
Boolean indicating whether (the requested version of) Hspell was found.
|
|
|
|
``HSPELL_VERSION``
|
|
.. versionadded:: 4.2
|
|
|
|
The version of Hspell found (x.y).
|
|
|
|
``HSPELL_VERSION_MAJOR``
|
|
The major version of Hspell found.
|
|
|
|
``HSPELL_VERSION_MINOR``
|
|
The minor version of Hspell found.
|
|
|
|
Cache Variables
|
|
^^^^^^^^^^^^^^^
|
|
|
|
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
|
|
^^^^^^^^
|
|
|
|
Finding Hspell:
|
|
|
|
.. code-block:: cmake
|
|
|
|
find_package(HSPELL)
|
|
#]=======================================================================]
|
|
|
|
cmake_policy(PUSH)
|
|
cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
|
|
|
|
find_path(HSPELL_INCLUDE_DIR hspell.h)
|
|
|
|
find_library(HSPELL_LIBRARIES NAMES hspell)
|
|
|
|
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 "${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)
|
|
|
|
mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
|
|
|
|
cmake_policy(POP)
|