[CMake] add_custom_command as target

Brandon Van Every bvanevery at gmail.com
Thu Jan 17 05:24:39 EST 2008


On Jan 17, 2008 5:10 AM, Gonzalo Garramuño <ggarra at advancedsl.com.ar> wrote:
>
> Is there a way to create an add_custom_target that tracks dependencies?
>   Or an add_custom_command that will act as a target (without needlessly
> being added to add_executable, etc).

To get the effect of that, you wrap your add_custom_command with an
add_custom_target.

add_custom_command(OUTPUT blah ...)
add_custom_target(mytarget DEPENDS blah ...)

Admittedly this is inelegant, but it works.  I have no idea how much
work it would be to remove the distinction between file level and
target level dependencies.


Cheers,
Brandon Van Every


More information about the CMake mailing list