From bf2244681b2cbbd2684187e628e00c0600ae4122 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sun, 7 Jul 2019 15:59:47 -0700 Subject: CheckSymbolExists: Add examples for check_symbol_exists Add examples in `CheckCXXSymbolExists` too. Co-Author: Brad King --- Modules/CheckCXXSymbolExists.cmake | 11 +++++++++++ Modules/CheckSymbolExists.cmake | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index 3364e2f..b112094 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -44,6 +44,17 @@ the way the check is run: command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` execute quietly without messages. + +For example: + +.. code-block:: cmake + + include(CheckCXXSymbolExists) + + # Check for macro SEEK_SET + check_cxx_symbol_exists(SEEK_SET "cstdio" HAVE_SEEK_SET) + # Check for function std::fopen + check_cxx_symbol_exists(std::fopen "cstdio" HAVE_STD_FOPEN) #]=======================================================================] include_guard(GLOBAL) diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index b9ef808..c2f488a 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -45,6 +45,17 @@ the way the check is run: command. See policy :policy:`CMP0075`. ``CMAKE_REQUIRED_QUIET`` execute quietly without messages. + +For example: + +.. code-block:: cmake + + include(CheckSymbolExists) + + # Check for macro SEEK_SET + check_symbol_exists(SEEK_SET "stdio.h" HAVE_SEEK_SET) + # Check for function fopen + check_symbol_exists(fopen "stdio.h" HAVE_FOPEN) #]=======================================================================] include_guard(GLOBAL) -- cgit v0.12