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