[CMake] Some questions about dependencies

Alexander Neundorf a.neundorf-work at gmx.net
Mon Apr 26 15:54:16 EDT 2010


On Friday 23 April 2010, Magnus Therning wrote:
> Does INSTALL( FILES ... ) have the same limitations regarding the location
> of the commands that generate the files in question as ADD_CUSTOM_COMMAND(
> ... DEPENDS ... ) has?
>
> That is, proper dependencies for the files given to INSTALL will only be
> generated when the files are the output of a custom command in the same
> directory.

I haven't tried that, but I think the only dependency the install target has 
is a dependency to "all", AFAIK it doesn't by itself drive the creation of 
file via add_custom_command().

To have a custom_command executed which produces a file which is not used in 
any target but which should be installed, you may have to use 
add_custom_command(... ALL ...) or something like that.

Alex


More information about the CMake mailing list