1 # - Check if a symbol exists as a function, variable, or macro in C++
2 # CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
4 # Check that the <symbol> is available after including given header
5 # <files> and store the result in a <variable>. Specify the list
6 # of files in one argument as a semicolon-separated list.
7 # CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as opposed
8 # to CHECK_SYMBOL_EXISTS(), which works only for C.
10 # If the header files define the symbol as a macro it is considered
11 # available and assumed to work. If the header files declare the
12 # symbol as a function or variable then the symbol must also be
13 # available for linking. If the symbol is a type or enum value
14 # it will not be recognized (consider using CheckTypeSize or
15 # CheckCSourceCompiles).
17 # The following variables may be set before calling this macro to
18 # modify the way the check is run:
20 # CMAKE_REQUIRED_FLAGS = string of compile command line flags
21 # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
22 # CMAKE_REQUIRED_INCLUDES = list of include directories
23 # CMAKE_REQUIRED_LIBRARIES = list of libraries to link
25 #=============================================================================
26 # Copyright 2003-2011 Kitware, Inc.
28 # Distributed under the OSI-approved BSD License (the "License");
29 # see accompanying file Copyright.txt for details.
31 # This software is distributed WITHOUT ANY WARRANTY; without even the
32 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
33 # See the License for more information.
34 #=============================================================================
35 # (To distribute this file outside of CMake, substitute the full
36 # License text for the above reference.)
38 include(CheckSymbolExists)
40 macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
41 _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )