[CMake] autoheader

Alexander Neundorf a.neundorf-work at gmx.net
Tue Mar 31 15:56:28 EDT 2009


On Tuesday 31 March 2009, Bill Hoffman wrote:
> Marcel Loose wrote:
> > Hi Bill,
> >
> > Wouldn't it be better if CMake kept track of these variables internally.
> > I mean, usually the HAS_X variables are the result of calls to
> > check_include_file() and check_function_exists(). The Autotools handle
> > this under the hood.
> > CMake might keep a list of these variables, possibly one per check_*()
> > function. Or is there a reason to let the user handle this explicitly by
> > specifying the list of HAS_X variables in the call to
> > cmake_autoheader()?
>
> check_include_file does not even have to be used, there are lots of ways
> to come up with variables that might be useful in a configured header
> file. I don't really like magic behind the scene lists getting created.

I fully agree with that.
Making it explicit is better, it makes the cmake code easier to read and 
understand (while requiring a bit more typing).

Alex


More information about the CMake mailing list