[CMake] How can I run my excutable in build

Matthew Woehlke matthew.woehlke at kitware.com
Tue May 14 15:07:36 EDT 2013


On 2013-05-14 14:58, Nils Gladitz wrote:
> Unless I misunderstand the documentation a target level dependency is
> automatically added if the command references a target created by
> add_executable.

That may be; I didn't check. Personally, I'd be inclined to be paranoid 
and list it anyway :-). At worst it is superfluous, but it can also 
serve to 'remind' someone looking at the code that may not know about 
the implicit dependency.

(Actually, another argument is that listing the generator as a 
dependency is much more likely to break early - i.e. at configure time 
rather than build time - if the generator target gets renamed but the 
custom command gets overlooked. Also, explicitly depending on the 
generator to force the target to re-run can also apply to non-target 
generators :-).)

-- 
Matthew



More information about the CMake mailing list