[CMake] Newbie question: generated header file howto

Pacesie ps at pacesie.name
Thu Jan 10 16:05:40 EST 2008


On Jan 10, 2008 11:50 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:

> Pacesie wrote:
> > 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.
> >
>
> Add the .h file as a source file of the target that uses it.
>
> -Bill
>


If I want to generate document files as part of the build, should I first
create an ADD_CUSTOM_TARGET then have it depends on the generated files
defined by ADD_CUSTOM_COMMAND? ( It would be nice if file generation can be
defined as a target so the extra step is not needed. )

Do the targets always run by the order that they are defined in CMakeLists
(unless there are dependency) ? So that if I want to be sure a target is run
before all others, I define it first in CMakeLists?

Thank you,
Pacesie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080111/3de59d8f/attachment.htm


More information about the CMake mailing list