[From nobody Mon Mar 30 09:06:49 2009
Date: Mon, 30 Mar 2009 15:04:43 +0200
From: &quot;Marcel Loose&quot; &lt;loose@astron.nl&gt;
To: &lt;bill.hoffman@kitware.com&gt;
Subject: Re: [CMake] autoheader
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi Bill,

This really is a feature I've been missing in CMake as well.
As far as autoheader is concerned, I suggest you'd read at least the
documentation that comes with it ('info autoheader' on Linux).

Basically, what autoheader does is convert any AC_DEFINE into a template
for a preprocessor definition, which is very much what #cmakedefine is.

Furthermore, autoheader will generate templates for any symbol that is
defined by functions like AC_CHECK_HEADERS, and AC_CHECK_FUNCS, etc. In
CMake terms, this would mean that for functions like
check_include_file() and check_function_exists(), CMake would generate a
#cmakedefine statement in the template config.h.in file.

So, I think you would need a variable that will hold the name of the
config.h.in file (or whatever name the user wants to use), e.g.
PROJECT_CONFIG_HEADER_FILE. To add a #cmakedefine line to this template
file you could use something like add_definition_template(preprocvar)
To actually generate the config.h file from config.h.in you could have a
function like generate_config_header_file(), which should run
configure_file() on the previously generated template header file.

I hope you more or less understand what I just wrote down, because I
didn't give it a thorough thought. Anyway, I'd love to see this feature
added to CMake.

Best regards,
Marcel Loose.
=20

On Mon, 2009-03-30 at 08:24 -0400, Bill Hoffman wrote:
&gt; I have seen several requests for an autoheader type function to be =
added=20
&gt; to CMake.  I have never used autoheader, but I gather it takes a list =
of=20
&gt; variables and generates a config.h.in file automatically.  Does =
anyone=20
&gt; on the list have experience with autoheader?   If so, what would a =
nice=20
&gt; CMake api for something like this look like?
&gt;=20
&gt; Thanks.
&gt;=20
&gt; -Bill
&gt;=20
&gt; _______________________________________________
&gt; Powered by www.kitware.com
&gt;=20
&gt; Visit other Kitware open-source projects at http://www.kitware.com/openso=
urce/opensource.html
&gt;=20
&gt; Please keep messages on-topic and check the CMake FAQ at: http://www.cmak=
e.org/Wiki/CMake_FAQ
&gt;=20
&gt; Follow this link to subscribe/unsubscribe:
&gt; http://www.cmake.org/mailman/listinfo/cmake

]
