mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
CheckInclude{FileCXX,File,Files}: Add examples
This adds some examples to modules for checking headers.
This commit is contained in:
@@ -35,9 +35,24 @@ the way the check is run:
|
||||
|
||||
.. include:: /module/CMAKE_REQUIRED_QUIET.txt
|
||||
|
||||
See the :module:`CheckIncludeFiles` module to check for multiple headers
|
||||
at once. See the :module:`CheckIncludeFileCXX` module to check for headers
|
||||
using the ``CXX`` language.
|
||||
Examples
|
||||
^^^^^^^^
|
||||
|
||||
Checking whether the ``C`` header ``<unistd.h>`` exists and storing the check
|
||||
result in the ``HAVE_UNISTD_H`` cache variable:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
include(CheckIncludeFile)
|
||||
|
||||
check_include_file(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
See Also
|
||||
^^^^^^^^
|
||||
|
||||
* The :module:`CheckIncludeFileCXX` module to check for single ``C++`` header.
|
||||
* The :module:`CheckIncludeFiles` module to check for one or more ``C`` or
|
||||
``C++`` headers at once.
|
||||
#]=======================================================================]
|
||||
|
||||
include_guard(GLOBAL)
|
||||
|
||||
Reference in New Issue
Block a user