[CMake] Adding non-file dependencies to a custom target

Alexander Neundorf a.neundorf-work at gmx.net
Tue Oct 21 15:39:09 EDT 2008


On Tuesday 21 October 2008, Giampiero Salvi wrote:
> Alexander Neundorf wrote:
...
> > Doesn't the custom target foo create some file ?
>
> In reality the foo target (or rather targets because I have many like
> that) crates many files that the "real" bar2 target wraps into one
> executable using tclkit and sdx (http://www.equi4.com/starkit/sdx.html).
> For each foo target there is usually a library (.so or .dll) and a
> number of tcl files. 

If you can make the add_custom_command() depend on the library target this 
should work. If the library is rebuilt, the add_custom_command() should run 
again.

Alternatively, could you make the add_custom_command() depend on a file like 
foo_dummy, which is generated every time the custom target is built just for 
the purpose that the add_custom_command can depend on it ?

Alex


More information about the CMake mailing list