You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.9 KiB

  1. # - Check if a symbol exists as a function, variable, or macro in C++
  2. # CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
  3. #
  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.
  9. #
  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).
  16. #
  17. # The following variables may be set before calling this macro to
  18. # modify the way the check is run:
  19. #
  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
  24. #=============================================================================
  25. # Copyright 2003-2011 Kitware, Inc.
  26. #
  27. # Distributed under the OSI-approved BSD License (the "License");
  28. # see accompanying file Copyright.txt for details.
  29. #
  30. # This software is distributed WITHOUT ANY WARRANTY; without even the
  31. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  32. # See the License for more information.
  33. #=============================================================================
  34. # (To distribute this file outside of CMake, substitute the full
  35. # License text for the above reference.)
  36. include(CheckSymbolExists)
  37. macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
  38. _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
  39. endmacro()