Warning, /frameworks/kdelibs4support/cmake/modules/CheckPrototypeExists.cmake is written in an unsupported language. File is not indexed.

0001 # - Check if the prototype for a function exists.
0002 # CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
0003 #
0004 #  FUNCTION - the name of the function you are looking for
0005 #  HEADER - the header(s) where the prototype should be declared
0006 #  VARIABLE - variable to store the result
0007 #
0008 # The following variables may be set before calling this macro to
0009 # modify the way the check is run:
0010 #
0011 #  CMAKE_REQUIRED_FLAGS = string of compile command line flags
0012 #  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
0013 #  CMAKE_REQUIRED_INCLUDES = list of include directories
0014 
0015 # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
0016 #
0017 # Redistribution and use is allowed according to the terms of the BSD license.
0018 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0019 
0020 
0021 INCLUDE(CheckCXXSourceCompiles)
0022 
0023 MACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
0024    SET(extra_macro_args ${ARGN})
0025    LIST(LENGTH extra_macro_args num_extra_args)
0026    SET(_PROTOTYPE "")
0027    IF (${num_extra_args} EQUAL 1)
0028       LIST(GET extra_macro_args 0 _PROTOTYPE)
0029    ENDIF ()
0030 
0031    SET(_INCLUDE_FILES)
0032    FOREACH (it ${_HEADER})
0033       SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
0034    ENDFOREACH (it)
0035 
0036    SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
0037 ${_INCLUDE_FILES}
0038 int main()
0039 {
0040 #ifndef ${_SYMBOL}
0041    int i = sizeof(${_PROTOTYPE}&${_SYMBOL});
0042 #endif
0043   return 0;
0044 }
0045 ")
0046    CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
0047 ENDMACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
0048