Re: [CMake] Generating include files

2017-05-20 Thread Florent Castelli
On 20/05/2017 13:32, Urs Thuermann wrote: Yes, but not directly. The executable depends on the object file, and the object file depends on the (created) source file. Since "depends on" is transitive, the executable also depends on the source file. Still, I would prefer to write add_executable(f

Re: [CMake] Generating include files

2017-05-20 Thread Urs Thuermann
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 correct. Obviously, we ha

Re: [CMake] Generating include files

2017-05-20 Thread Hendrik Sattler
Am 20. Mai 2017 11:16:54 MESZ schrieb Urs Thuermann : >Craig Scott writes: >> add_executable(foo foo.c) >> set_source_files_properties(foo.c PROPERTIES OBJECT_DEPENDS >> ${CMAKE_BINARY_DIR}/tab.h) > >IMO that feels just wrong. foo.c does NOT depend on tab.h, foo.c does >not depend on an

Re: [CMake] Generating include files

2017-05-20 Thread Craig Scott
On Sat, May 20, 2017 at 7:16 PM, Urs Thuermann wrote: > Craig Scott writes: > > > Another choice is to set the OBJECT_DEPENDS property on foo.c, even > though > > the documentation for that source property says it shouldn't be needed. > The > > OBJECT_DEPENDS property sets up a dependency betwee

Re: [CMake] Generating include files

2017-05-20 Thread Urs Thuermann
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 created by a custom comma

Re: [CMake] Generating include files

2017-05-20 Thread Urs Thuermann
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() specification. I am new to cma