~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/cmake/modules/CheckPrototypeExists.cmake

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
#
 
5
# - Check if the prototype for a function exists.
 
6
# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
 
7
#
 
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
 
11
#
 
12
 
 
13
# AWI further change from C++ to C since that is the core PLplot language.
 
14
INCLUDE(CheckCSourceCompiles)
 
15
 
 
16
MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
17
   SET(_INCLUDE_FILES)
 
18
   FOREACH(it ${_HEADER})
 
19
      SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
 
20
   ENDFOREACH(it)
 
21
 
 
22
   SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
 
23
${_INCLUDE_FILES}
 
24
void cmakeRequireSymbol(int dummy,...){(void)dummy;}
 
25
int main()
 
26
{
 
27
#ifndef ${_SYMBOL}
 
28
#ifndef _MSC_VER
 
29
  cmakeRequireSymbol(0,&${_SYMBOL});
 
30
#else
 
31
  char i = sizeof(&${_SYMBOL});
 
32
#endif
 
33
#endif
 
34
  return 0;
 
35
}
 
36
")
 
37
   CHECK_C_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 
38
ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
39