[CMake] check_include_file macro

Bill Hoffman bill.hoffman at kitware.com
Sat Mar 1 22:39:24 EST 2008


Steven Van Ingelgem wrote:
> The use case here is more like:
> 
> - run CMake:
> 
> check_include_file(uuid/uuid.h HAS_UUID_H)
> if(not HAS_UUID_H) --> Fatal error + help how to resolve it.
> 
> - resolve the problem
> 
> - re-run CMake.
> 
> 

find_path might be a better choice in this case as that is what it was 
designed to do. check_include_file uses the compiler, in the test is 
only done once as it would make configure checks very slow if every not 
found .h file was re-found every time cmake ran.  For find_path if it is 
not found the variable will get put in the cache with a value of 
NOTFOUND.  As long as it is NOTFOUND CMake will keep looking each time 
it is run.

-Bill


More information about the CMake mailing list