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

Eduardo Alberto Hernández Muñoz coz.eduardo.hernandez at gmail.com
Tue Jun 3 22:06:15 EDT 2008


Hi,

>> 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.

I understand that unpredictable results can come from running a cmake
file with try_run more than once.

However I usually delete the contents of the binary directory, where
the files are stored after try_run; after your reply, I also tried
deleting the CMakeCache.txt and CMakeFiles/ directory in the source
directory in addition to deleting the contents of the binary
directory. The problem persists.

On the other hand, your advice on modifying the cache works well, so
now I can go on with debugging. =] (dumb me, should have tried that).
On the other hand, I'm not sure if I should fill a bug or not, since
the problem happens even on the first try.

-Coz


More information about the CMake mailing list