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

Robert Dailey rcdailey.lists at gmail.com
Tue May 14 17:42:19 EDT 2013


What target property does TARGET_FILE_DIR access when used in a
generator expression? I'm thinking I might be able to set the output
directory directly to the custom target for each configuration. If I
know which target property to set, this might work. Thanks Brad.

On Mon, May 13, 2013 at 2:01 PM, Brad King <brad.king at kitware.com> wrote:
> 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