[CMake] TRY_RUN wrong program return value with --debug-compile

Bill Hoffman bill.hoffman at kitware.com
Tue Jun 3 20:57:16 EDT 2008


Eduardo Alberto Hernández Muñoz wrote:

> 
>>> The interesting part, is that this problem only happens when I pass
>>> the --debug-trycompile to cmake. Without the flag, CMake works
>>> wonderfully.
>> That option is known to cause such problems, don't know why.
> 
> It's a bother that it causes trouble, because it is pretty useful for
> debugging. I'll get the CMake HEAD, and if the problem persists there,
> I'll file a bug.
> 

Don't bother, it is not something we can fix.  Between each try compile 
cmake removes all the files generated during the try compile.  If you 
turn on debug try compile then it leaves all the files.  It is a 
debugging tool only.  The unpredictable results are the fault of files 
being left from the last try compile interfering with the current one. 
The best way to use debug-trycompile is to run cmake, then remove the 
cache entry for the one that is giving you trouble, then run with 
--debug-trycompile.  This should give the same result as running without 
debug trycompile since only one try-compile result will be around.

-Bill



More information about the CMake mailing list