[CMake] CMake and HAVE_SIGFPE

Alexander Neundorf a.neundorf-work at gmx.net
Wed Mar 18 19:08:21 EDT 2009


On Wednesday 18 March 2009, Denis Scherbakov wrote:
> Dear CMake Community,
>
> Could anyone give me a hint, how to check if a system can handle SIGFPE
> signal and set HAVE_SIGFPE variable.
>
> For example, linux on alpha machines produces a core dump instead of
> SIGFPE.

When do you get a SIGFPE, by division by zero ?
Maybe you can write a small testprogram which does a division by zero, and 
install a signal handler for SIGFPE which exits the program cleanly.
On a system without that signal you may get a crash and via 
CHECK_C_SOURCE_RUNS() or something like this you may be able to detect the 
difference.

Alex


More information about the CMake mailing list