[CMake] Following dependencies through generated header file

Óscar Fuentes ofv at wanadoo.es
Mon Oct 4 10:23:07 EDT 2010


Michael Hertling <mhertling at online.de>
writes:

[snip]

> The basic idea is the following: The custom target foo invokes a script
> scandeps.cmake which uses an external dependency scanner - here, gcc's
> -M facility - to get the files zoo.cpp depends on.

[snip]

> This approach works on *nix
> with Makefiles, but I don't know if it's suitable for other generators
> or IDE's.

At some point on the past, the project did something similar for
regenerating library dependencies on the fly. That feature was removed
by someone because "it was an ugly hack". And indeed it was, but it kept
a working build in circunstances where now breaks. Its major drawback
what that it only worked well with makefile generators. Obtaining header
dependencies has the added problem that each compiler has its own method
for getting them.

I think that the procedure described on your previous post is the one to
consider.

Thanks Michael.



More information about the CMake mailing list