comparison interps/cfunge/cfunge-src/cmake/modules/CfungeCheckFunction.cmake @ 996:859f9b4339e6

<Gregor> tar xf egobot.tar.xz
author HackBot
date Sun, 09 Dec 2012 19:30:08 +0000
parents
children
comparison
equal deleted inserted replaced
995:6883f5911eb7 996:859f9b4339e6
1 # - Check if a given function exists; add define and set variable if found.
2 # CFUNGE_CHECK_FUNCTION(_name)
3 #
4 # _name - Function name to check for.
5 #
6 # The same variables as for CheckFunctionExists affect this macro.
7 #
8 # Will set CFUNGE_CHECKFUNC_<name> (as CheckFunctionExists out variable).
9 # Will #define HAVE_<name> if found.
10 # Will set the variable CFUNGE_HAVE_<name> if found.
11 #
12
13 # cfunge - A standard-conforming Befunge93/98/109 interpreter in C.
14 # Copyright (C) 2008 Arvid Norlander <anmaster AT tele2 DOT se>
15 #
16 # This program is free software: you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation, either version 3 of the License, or
19 # (at the proxy's option) any later version. Arvid Norlander is a
20 # proxy who can decide which future versions of the GNU General Public
21 # License can be used.
22 #
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
27 #
28 # You should have received a copy of the GNU General Public License
29 # along with this program. If not, see <http://www.gnu.org/licenses/>.
30
31
32 include(CheckFunctionExists)
33
34 macro(CFUNGE_CHECK_FUNCTION _name)
35 CHECK_FUNCTION_EXISTS(${_name} CFUNGE_CHECKFUNC_${_name})
36 if (CFUNGE_CHECKFUNC_${_name})
37 set(CFUNGE_HAVE_${_name} true PARENT_SCOPE)
38 add_definitions(-DHAVE_${_name})
39 endif (CFUNGE_CHECKFUNC_${_name})
40 endmacro(CFUNGE_CHECK_FUNCTION)