1 # - Define macro to check if isfinite or _isfinite exists
3 # gmx_test_isfinite(VARIABLE)
5 # VARIABLE will be set to true if isfinite exists
7 # gmx_test__isfinite(VARIABLE)
9 # VARIABLE will be set to true if _isfinite exists
11 # gmx_test__finite(VARIABLE) - disabled since it doesn't seem to work the way the MSVC docs suggest
13 # VARIABLE will be set to true if _finite exists
16 MACRO(gmx_test_isfinite VARIABLE)
17 MESSAGE(STATUS "Checking for isfinite")
19 set(CMAKE_REQUIRED_INCLUDES "math.h")
20 set(CMAKE_REQUIRED_LIBRARIES "m")
21 check_c_source_compiles(
26 }" isfinite_compile_ok)
28 if(isfinite_compile_ok)
29 MESSAGE(STATUS "Checking for isfinite - yes")
30 set(${VARIABLE} ${isfinite_compile_ok}
31 "Result of test for isfinite")
32 else(isfinite_compile_ok)
33 MESSAGE(STATUS "Checking for isfinite - no")
34 endif(isfinite_compile_ok)
35 ENDMACRO(gmx_test_isfinite VARIABLE)
37 MACRO(gmx_test__isfinite VARIABLE)
38 MESSAGE(STATUS "Checking for _isfinite")
40 set(CMAKE_REQUIRED_INCLUDES "math.h")
41 set(CMAKE_REQUIRED_LIBRARIES "m")
42 check_c_source_compiles(
47 }" _isfinite_compile_ok)
49 if(_isfinite_compile_ok)
50 MESSAGE(STATUS "Checking for _isfinite - yes")
51 set(${VARIABLE} ${_isfinite_compile_ok}
52 "Result of test for _isfinite")
53 else(_isfinite_compile_ok)
54 MESSAGE(STATUS "Checking for _isfinite - no")
55 endif(_isfinite_compile_ok)
56 ENDMACRO(gmx_test__isfinite VARIABLE)
59 MACRO(gmx_test__finite VARIABLE)
60 MESSAGE(STATUS "Checking for _finite")
62 set(CMAKE_REQUIRED_INCLUDES "float.h")
63 check_c_source_compiles(
68 }" _finite_compile_ok)
70 if(_finite_compile_ok)
71 MESSAGE(STATUS "Checking for _finite - yes")
72 set(${VARIABLE} ${_finite_compile_ok}
73 "Result of test for _finite")
74 else(_finite_compile_ok)
75 MESSAGE(STATUS "Checking for _finite - no")
76 endif(_finite_compile_ok)
77 ENDMACRO(gmx_test__finite VARIABLE)