1
# AWI, downloaded from KDE repository since has not yet been transferred
2
# to cmake repository as of 2006-07-31.
3
# http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/CheckPrototypeExists.cmake?rev=505849&view=markup
5
# - Check if the prototype for a function exists.
6
# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
8
# FUNCTION - the name of the function you are looking for
9
# HEADER - the header(s) where the prototype should be declared
10
# VARIABLE - variable to store the result
13
# AWI further change from C++ to C since that is the core PLplot language.
14
INCLUDE(CheckCSourceCompiles)
16
MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
18
FOREACH(it ${_HEADER})
19
SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
22
SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
24
void cmakeRequireSymbol(int dummy,...){(void)dummy;}
29
cmakeRequireSymbol(0,&${_SYMBOL});
31
char i = sizeof(&${_SYMBOL});
37
CHECK_C_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
38
ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)