annotate armadillo-2.4.4/build_aux/cmake/Modules/ARMA_CheckMathProto.cmake @ 48:69251e11a913

Rename SongParts/songpartitioner to Segmentino throughout
author Chris Cannam
date Thu, 13 Jun 2013 09:43:01 +0100
parents 8b6102e2a9b0
children
rev   line source
max@0 1 # - Check if the prototype for a single argument math function exists.
max@0 2 # ARMA_CHECK_MATH_PROTO (FUNCTION NAMESPACE HEADER VARIABLE)
max@0 3 #
max@0 4 # FUNCTION - the name of the single argument math function you are looking for
max@0 5 # NAMESPACE - the name of the namespace
max@0 6 # HEADER - the header(s) where the prototype should be declared
max@0 7 # VARIABLE - variable to store the result
max@0 8 #
max@0 9 # The following variables may be set before calling this macro to
max@0 10 # modify the way the check is run:
max@0 11 #
max@0 12 # CMAKE_REQUIRED_FLAGS = string of compile command line flags
max@0 13 # CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
max@0 14 # CMAKE_REQUIRED_INCLUDES = list of include directories
max@0 15
max@0 16 # adapted from "CheckPrototypeExists.cmake"
max@0 17 # ( http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/CheckPrototypeExists.cmake )
max@0 18 # on 2009-06-19 by Conrad Sanderson (conradsand at ieee dot org)
max@0 19
max@0 20 # original copyright for "CheckPrototypeExists.cmake":
max@0 21 #
max@0 22 # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
max@0 23 #
max@0 24 # Redistribution and use is allowed according to the terms of the BSD license.
max@0 25 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
max@0 26
max@0 27
max@0 28 INCLUDE(CheckCXXSourceCompiles)
max@0 29
max@0 30 MACRO (ARMA_CHECK_MATH_PROTO _SYMBOL _NAMESPACE _HEADER _RESULT)
max@0 31
max@0 32 SET(_INCLUDE_FILES)
max@0 33
max@0 34 FOREACH (it ${_HEADER})
max@0 35 SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
max@0 36 ENDFOREACH (it)
max@0 37
max@0 38 SET(_TMP_SOURCE_CODE "
max@0 39 ${_INCLUDE_FILES}
max@0 40 int main()
max@0 41 {
max@0 42 #if !defined(${_SYMBOL})
max@0 43 int i = (${_NAMESPACE}::${_SYMBOL})(1.0);
max@0 44 #endif
max@0 45 return 0;
max@0 46 }
max@0 47 ")
max@0 48
max@0 49 CHECK_CXX_SOURCE_COMPILES("${_TMP_SOURCE_CODE}" ${_RESULT})
max@0 50
max@0 51 ENDMACRO (ARMA_CHECK_MATH_PROTO _SYMBOL _NAMESPACE _HEADER _RESULT)