[geos-devel] [#317] Build configuration for CMake build system

Sandro Santilli strk at keybit.net
Tue Jan 26 11:23:08 EST 2010


On Mon, Jan 25, 2010 at 10:17:34PM +0000, Mateusz Loskot wrote:

> The problem is not with CMake, but looks like GCC is a mess :-)

Interesting analisys :)

> #include <math.h>
> #ifdef isfinite
> #error isfinite defined
> #else
> #error isfinite NOT defined
> #endif

I guess you just can't expect isfinite to necessarely be a macro.
It could be a real function too.

The autotool based version of the check actually attempts linking
to figure out:

  dnl - Look for finite and/or isfinite macros/functions
  ...
   [AC_TRY_LINK([#include <math.h>],
  ...

> The simplest one would be to define something like this:
> 
> inline bool isfinite(double v)
> {
>    return v >= -(std::numeric_limits<double>::max)()
>        && v <=  (std::numeric_limits<double>::max)();
> }
> 
> but I'm concerned if it is robust enough on variety of platforms.

I suggest you do some more research on how cmake handles the case
in which a symbol may be a macro or function.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://foo.keybit.net/~strk/services.html


More information about the geos-devel mailing list