[CMake] CHECK_FUNCTION_EXISTS() issue

Crni Gorac cgorac at gmail.com
Thu Aug 3 10:42:15 EDT 2006


On 8/3/06, Brad King <brad.king at kitware.com> wrote:
> Crni Gorac wrote:
> >
> >  [ ... ]
> >
> >
> > However, there is a problem with CHECK_FUNCTION_EXIST() macro, namely
> > after calling it first time, looks like the result is cached and macro
> > body is not executed when macro later called again within FOREACH
> > loop.  So my question is - is there a way to employ this macro to
> > check if given function exists in kind of loop?
>
> The result is cached so that CMake doesn't have to do the same tests
> over and over each time it re-runs to update the build system.  You
> should use a different variable name for each test.  Using
> OPENMP_FUNCTION_FOUND${FLAG} instead of OPENMP_FUNCTION_FOUND should
> work because variables can contain dashes.
>
> -Brad
>

Works great, thanks.

Regards.


More information about the CMake mailing list