[CMake] Newbie question: generated header file howto

Pacesie ps at pacesie.name
Thu Jan 10 07:17:51 EST 2008


Hello,

In my C++ program I want to auto-generate a header ( .h ) file, which is
included in most sources. I use ADD_CUSTOM_COMMAND to generate it, but I
don't know how to neatly write the dependency to it.

I could use ADD_DEPENDENCY to add the generated header to all final targets,
but it will get messy if I have lots of targets and generated headers.

Is there a way such that generated-files are checked in each invocation of
make without explicitly referring it as a dependency to something? ie.
generated file as a final target, like ADD_CUSTOM_TARGET with the ALL option
but not phony.

Regards
Pacesie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080110/12c78a0b/attachment.html


More information about the CMake mailing list