Oops, forgot to reply to the mailing list as well.
--- Begin Message ---
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.
On Mon, 2009-03-30 at 08:24 -0400, Bill Hoffman wrote:
> I have seen several requests for an autoheader type function to be added
> to CMake. I have never used autoheader, but I gather it takes a list of
> variables and generates a config.h.in file automatically. Does anyone
> on the list have experience with autoheader? If so, what would a nice
> CMake api for something like this look like?
>
> Thanks.
>
> -Bill
>
> _______________________________________________
> 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
--- End Message ---
_______________________________________________
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