On Tue, Mar 31, 2009 at 7:04 AM, BRM <span dir="ltr"><<a href="mailto:bm_witness@yahoo.com">bm_witness@yahoo.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I think the better solution would be to have the various Find functions (package, library, program) define a variable for that package to an internal list - which is what I think Marcel might have been hinting at.<br>
The user could add more variables to the same internal list.<br>
<br>
So essentially:<br>
<br>
# package defines its own automatically<br>
find_package(some package)<br>
if (some_package_found)<br>
-> cmake_autoheader_add_variable(has_some_package)<br>
...<br>
# user can add it too<br>
cmake_autoheader_add_variable(has_some_other_package)<br>
<br>
# user controls what the output file is<br>
# User can generate a C #define method (default method if no language is specified)<br>
cmake_autoheader(C, path/to/cmake/autoheader_output.h)<br>
# User can generate a C++ const methods<br>
cmake_autoheader(CXX, path/to/cmake/autoheader_output.hpp)<br>
...<br>
<br>
This would allow CMake to be a true platform for autoheaders as people would not have to think up variables for every project.<br>
<br>
So FindQt() would add HAS_QT and HAS_QT4 or HAS_QT3 or whatever version it is finding.<br>
Perhaps the various variables that the find_package() declares should also be included in the list<br>
<br>
<br>
Just 2 cents.<br>
<br>
Ben<br>
<div><div></div><div class="h5"><br>
<br>
----- Original Message ----<br>
From: Bill Hoffman <<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>><br>
To: Marcel Loose <<a href="mailto:loose@astron.nl">loose@astron.nl</a>><br>
Cc: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
Sent: Tuesday, March 31, 2009 7:44:23 AM<br>
Subject: Re: [CMake] autoheader<br>
<br>
Marcel Loose wrote:<br>
> Hi Bill,<br>
><br>
> Wouldn't it be better if CMake kept track of these variables internally.<br>
> I mean, usually the HAS_X variables are the result of calls to<br>
> check_include_file() and check_function_exists(). The Autotools handle<br>
> this under the hood.<br>
> CMake might keep a list of these variables, possibly one per check_*()<br>
> function. Or is there a reason to let the user handle this explicitly by<br>
> specifying the list of HAS_X variables in the call to<br>
> cmake_autoheader()?<br>
><br>
<br>
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. Someone could just use a macro for check_include_file that appends to a list if they wanted.<br>
<br>
-Bill<br>
_______________________________________________<br></div></div></blockquote><div><br>If this feature comes to fruition, I would like the ability to specify which flags make it into what header. In one project I worked on all our configuration defines were in a single header. This caused extremely long recompiles if something happened to change the one autoheader. We eventually broke it into multiple files, and got targeted recompiles.<br>
<br>I also like the idea of not having to have a <a href="http://configure.h.in">configure.h.in</a> file like <span class="gI"><span class="gD" style="color: rgb(91, 16, 148);">Hendrik Sattler </span></span>suggested (put these variables in this header here).<br>
<br>James<br></div></div><br>