[CMake] CheckIncludeFiles: how to use?

Marcel Loose loose at astron.nl
Mon Jul 6 03:00:09 EDT 2009


OK, I see, thanks.

I was a bit confused, cause I think this is one of the few macros that
really needs a quoted list as argument to function properly. Unless I'm
mistaken, I think most other macro solve this "problem" by either
interchanging the result and input variables, or by using the input
argument as the name of the list, not the contents.

Best regards,
Marcel Loose.


On Fri, 2009-07-03 at 18:05 +0200, Alexander Neundorf wrote:
> On Thursday 02 July 2009, Marcel Loose wrote:
> > Hi David,
> >
> > That indeed seems to do the trick. The diagnostics are somewhat vague,
> > though, if not to say incorrect.
> >
> > -- Looking for include files var
> > -- Looking for include files var - found
> > -- var = 1
> >
> > I think the line
> >     MESSAGE(STATUS "Looking for include files ${VARIABLE}")
> > should read
> >     MESSAGE(STATUS "Looking for include files ${INCLUDE}")
> 
> Hmm, well, maybe.
> 
> > Also, the variable var is not cached; there's no trace whatsoever in the
> > CMakeCache.txt file of either stdio.h, unistd.h or var.
> 
> That's what I get with the attached CMakeLists.txt:
> ...
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Looking for unistd.h
> -- Looking for unistd.h - found
> -- Looking for include files HAVE_STDIO_AND_STRING_H
> -- Looking for include files HAVE_STDIO_AND_STRING_H - found
> -- HAVE_UNISTD_H: 1
> -- HAVE_STDIO_AND_STRING_H 1
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/alex/src/tests/cif/bH
> hammer:~/src/tests/cif/bH$ grep HAVE_STDIO CMakeCache.txt
> //Have include HAVE_STDIO_AND_STRING_H
> HAVE_STDIO_AND_STRING_H:INTERNAL=1
> 
> So, if the variable has a useful name the output is not that bad. It is also 
> cached.
> 
> > Seems to me that check_include_file() is preferred over
> > check_include_files(). Any idea what's the use of the latter?
> 
> E.g. it's necessary if you have to include a header B if you want to use 
> header A, then you need to be able to specify two header files.
> 
> Alex
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list