I\'m trying to get a file produced by an add_custom_command in one directory to be a dependency of an add_custom_command in another directory.
In the first directory (li
This is a non-answer but a clarification to one of your answers above.
According to the cmake documents, a custom target created by
add_custom_target
is always considered out of date and is always built.
IMO, the cmake documents should say instead:
A custom target created by add_custom_target is always considered out of date and is always built, but only when requested.
That means that if all of your targets are marked as EXCLUDE_FROM_ALL
, and you have add_custom_target
commands that create new targets, and you type make
from the command line with no targets specified, the targets added with add_custom_target
are not built. But if you spell them out on the make
command line explicitly, then they are built. Also, there is the ALL
keyword that you can specify to the add_custom_target
to force those to be built as a part of the all rule, which I believe means when make
is executed without arguments.