Michael Ellery writes:
> https://github.com/mellery451/gen_header
>
> works for with me with makefile generator.
Yes, that's similar to what I have found yesterday after my posting.
It works but I'd prefer not to have to add the dependency to the
add_executable()
Craig Scott writes:
> This property need not be used to specify the dependency of a source file
> on a generated header file that it includes. Although the property was
> originally introduced for this purpose, it is no longer necessary. If the
> generated header file is
Hendrik Sattler writes:
> >IMO that feels just wrong. foo.c does NOT depend on tab.h, foo.c does
> >not depend on anything, it's not even generated by the build system.
> >*I* edit it. Instead, it is the object file foo.o that depends on
> >tab.h.
> This is not quite
Michael Ellery writes:
> if your source can be generated by simple substitution of variable
> values (like a template file), then configure_file() will do the
> trick. If the process to create the file is more complex, then
> add_custom_command() with an appropriate OUTPUT
How can I write a CMakeFile that will include a generated source file
into another C source? I have read the FAQ, searched the mailing list
archives and have tried for two hours without success.
With standard make this would be quite simple:
$ cat Makefile
foo: foo.o
Craig Scott writes:
> A bit of a long-shot, have you tried generating the file with the extension
> .h instead of .c? That might allow it to be picked up by the dependency
> scanner (I don't know if it treats file extensions differently). Also, the
>