[cmake-developers] Need some pointers on learning the code

Brad King brad.king at kitware.com
Mon May 13 15:01:04 EDT 2013


On 05/13/2013 02:48 PM, Robert Dailey wrote:
> Interesting, I must have overlooked your comment on that issue. Will
> this also work for add_custom_command using the OUTPUT/DEPENDS/COMMAND
> arguments? I don't copy using a post build event, I create a custom
> target instead and attach the custom commands to it. I do it this way
> so that if the source DLLs change, the custom target will be smart
> enough to copy changed DLLs.

In the proposed approach the files will copy every time "foo" links,
and "foo" will re-link whenever the "z" library for the current
config changes.

In general though it does not hook up the dependencies directly.
You'll still need to look at adding generator expressions to
OUTPUT and DEPENDS for that.  Note that to handle different
names per-config you can do something like

 $<$<CONFIG:Debug>:debug>$<$<NOT:$<CONFIG:Debug>>:release>

-Brad



More information about the cmake-developers mailing list