[CMake] custom target like add_executable

Bill Newcomb bnewcomb at nvidia.com
Wed Feb 4 16:45:25 EST 2015


Oops, so I guess it's not that it doesn't work at all, but that the 
add_custom_command gets run every time I 'make all', and that gnu make 
emits some warnings about circular dependencies.  The first is more of a 
problem, but both are kind of annoying.

Thanks,
B.

On 02/04/2015 01:36 PM, Bill Newcomb wrote:
> When I specify add_executable(foo foo.c), I get both a top-level target
> (which defaults to ALL but can be set not to be) and an actual file that
> gets built that are named the same (Unix Makefiles).
>
> add_custom_target can get me the first of those for non-executable
> things, and add_custom_command can do the second.  However, I can't use
> the same thing for the first arg to add_custom_target and the OUTPUT of
> add_custom_command.
>
> Ideally what I'd like is a way to specify that a particular
> add_custom_command is also a top-level target (with ALL being settable
> on it).  Are there technical reasons this wouldn't be possible?
>
> Thanks,
> B.
>
> -----------------------------------------------------------------------------------
>
> This email message is for the sole use of the intended recipient(s) and
> may contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact
> the sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
>


More information about the CMake mailing list