[CMake] How to make sure "make test" depends on "make all"

Tyler Roscoe tyler at cryptio.net
Thu Jun 25 12:00:11 EDT 2009


On Thu, Jun 25, 2009 at 04:58:46PM +0300, Shlomi Fish wrote:
> On Thursday 25 June 2009 14:50:39 Marcel Loose wrote:
> > As you already found out the hard way, it is not possible to let the
> > target 'all' depend on, e.g., 'test'. Targets like 'all' and 'test' are
> > special to CMake.
> 
> OK. I want "check" or "test" to depend on "all" - not vice versa.

The best way I can think of is to collect all the targets that are run
when you do "make all" into ${all_targets} and then do:

add_dependencies (check ${all_targets})

hth,
tyler


More information about the CMake mailing list