max@0: # - Check if the prototype for a non-overloaded function exists in a specified namespace. max@0: # ARMA_CHECK_PROTO (FUNCTION NAMESPACE HEADER VARIABLE) max@0: # max@0: # FUNCTION - the name of the function you are looking for max@0: # NAMESPACE - the name of the namespace max@0: # HEADER - the header(s) where the prototype should be declared max@0: # VARIABLE - variable to store the result max@0: # max@0: # The following variables may be set before calling this macro to max@0: # modify the way the check is run: max@0: # max@0: # CMAKE_REQUIRED_FLAGS = string of compile command line flags max@0: # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) max@0: # CMAKE_REQUIRED_INCLUDES = list of include directories max@0: max@0: # adapted from "CheckPrototypeExists.cmake" max@0: # ( http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/CheckPrototypeExists.cmake ) max@0: # on 2009-06-19 by Conrad Sanderson (conradsand at ieee dot org) max@0: max@0: # original copyright for "CheckPrototypeExists.cmake": max@0: # max@0: # Copyright (c) 2006, Alexander Neundorf, max@0: # max@0: # Redistribution and use is allowed according to the terms of the BSD license. max@0: # For details see the accompanying COPYING-CMAKE-SCRIPTS file. max@0: max@0: max@0: INCLUDE(CheckCXXSourceCompiles) max@0: max@0: MACRO (ARMA_CHECK_PROTO _SYMBOL _NAMESPACE _HEADER _RESULT) max@0: max@0: SET(_INCLUDE_FILES) max@0: max@0: FOREACH (it ${_HEADER}) max@0: SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") max@0: ENDFOREACH (it) max@0: max@0: SET(_TMP_SOURCE_CODE " max@0: ${_INCLUDE_FILES} max@0: int max@0: main() max@0: { max@0: #if !defined(${_SYMBOL}) max@0: int i = sizeof(&(${_NAMESPACE}::${_SYMBOL})); max@0: #endif max@0: return 0; max@0: } max@0: ") max@0: max@0: CHECK_CXX_SOURCE_COMPILES("${_TMP_SOURCE_CODE}" ${_RESULT}) max@0: max@0: ENDMACRO (ARMA_CHECK_PROTO _SYMBOL _NAMESPACE _HEADER _RESULT) max@0: