MantisBT - CMake
View Issue Details
0014701CMakeCMakepublic2014-01-15 05:172014-06-02 08:38
Andreas Pakulat 
 
normalmajoralways
closedwon't fix 
CMake 2.8.12.1 
 
0014701: check_include_file never re-runs because it use the variable as cache
When using check_include_file to verify a certain header can be used, the result of the try_compile is cached by check_include_file using the same variable that is passed in to check_include_file. This means a second run of cmake will not run the try-compile again because the variable is already defined and hence the check at the top of check_include_file goes into the else branch.

This breaks the common idiom of running cmake for a project to find out which dependencies might be missing, then installing needed dependencies and simply re-run cmake (without deleting the build directory). In addition this is rather hard to debug for someone that just uses a project and is not overly familiar with CMake.
No tags attached.
Issue History
2014-01-15 05:17Andreas PakulatNew Issue
2014-01-15 09:48Brad KingNote Added: 0034944
2014-01-15 09:48Brad KingStatusnew => resolved
2014-01-15 09:48Brad KingResolutionopen => won't fix
2014-06-02 08:38Robert MaynardNote Added: 0036080
2014-06-02 08:38Robert MaynardStatusresolved => closed

Notes
(0034944)
Brad King   
2014-01-15 09:48   
The caching is by design. The try_compile checks can be expensive and there are often a lot of them. It is common practice to use a fresh build tree each time or at least "rm -rf CMakeCache.txt CMakeFiles" to re-run checks.
(0036080)
Robert Maynard   
2014-06-02 08:38   
Closing resolved issues that have not been updated in more than 4 months.