[Cmake] FILE WRITE and TRY_COMPILE

Andy Cedilnik andy.cedilnik at kitware.com
Thu, 06 May 2004 11:25:29 -0400


Hi Amitha,

Could you write example for where it fails?

Try_COMPILE creates internal CMake which uses internal tracking of
infinite loops. It should ignore the outer ones. 

That said, there may be bug with the code.

			Andy

On Thu, 2004-05-06 at 11:15, Amitha Perera wrote:
> It seems that the CVS version of CMake doesn't like the output of
> FILE WRITE being used as the source for TRY_COMPILE. The
> documentation of FILE WRITE suggests that this may cause infinite
> loops. The CVS CMake now issues an error when it detects this,
> causing an error in the VXL build. I've fixed this by replacing the
> FILE WRITE with an equivalent CONFIGURE IMMEDIATE file.
> 
> However, I notice that some CMake modules, like
> CheckSymbolExists.cmake still use FILE WRITE to generate a temporary
> file to feed into a TRY_COMPILE. Presumably, using this will not
> trigger the error message. A similar "one-line write" in VXL does not
> trigger an error message.
> 
> Under what conditions can the output of a FILE WRITE be used as input
> for a TRY_COMPILE?