1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-08 22:37:04 +08:00

FindEXPAT: Update documentation

- Added examples section.
- Module documentation synced a bit with other similar find modules.
- Descriptions synced.
This commit is contained in:
Peter Kokot 2025-04-02 02:05:48 +02:00
parent b6c88c0c5d
commit 8e91ee67d9
No known key found for this signature in database
GPG Key ID: A94800907AA79B36

View File

@ -5,36 +5,39 @@
FindEXPAT FindEXPAT
--------- ---------
Find the native Expat headers and library. Finds the native Expat headers and library. Expat is a stream-oriented XML
Expat is a stream-oriented XML parser library written in C. parser library written in C.
Imported Targets Imported Targets
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
.. versionadded:: 3.10 This module provides the following :ref:`Imported Targets`:
This module defines the following :prop_tgt:`IMPORTED` targets:
``EXPAT::EXPAT`` ``EXPAT::EXPAT``
The Expat ``expat`` library, if found. .. versionadded:: 3.10
Target encapsulating the Expat library (``expat``) usage requirements. This
target is available only if Expat is found.
Result Variables Result Variables
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
This module will set the following variables in your project: This module sets the following variables:
``EXPAT_INCLUDE_DIRS`` ``EXPAT_INCLUDE_DIRS``
where to find expat.h, etc. Include directories containing ``expat.h`` and related headers needed to use
Expat.
``EXPAT_LIBRARIES`` ``EXPAT_LIBRARIES``
the libraries to link against to use Expat. Libraries needed to link against to use Expat.
``EXPAT_FOUND`` ``EXPAT_FOUND``
true if the Expat headers and libraries were found. Boolean indicating whether the Expat is found.
Hints Hints
^^^^^ ^^^^^
``EXPAT_USE_STATIC_LIBS`` This module accepts the following variables:
``EXPAT_USE_STATIC_LIBS``
.. versionadded:: 3.28 .. versionadded:: 3.28
Set to ``TRUE`` to use static libraries. Set to ``TRUE`` to use static libraries.
@ -43,6 +46,15 @@ Hints
Implemented on non-Windows platforms. Implemented on non-Windows platforms.
Examples
^^^^^^^^
Finding Expat library and linking it to a project target:
.. code-block:: cmake
find_package(EXPAT)
target_link_libraries(project_target PRIVATE EXPAT::EXPAT)
#]=======================================================================] #]=======================================================================]
cmake_policy(PUSH) cmake_policy(PUSH)