views:

373

answers:

1

In Netbeans 6.5, I've got two different C++ application projects - my application and the unit tests. I want to set it up so that if my main application is rebuilt, the unit tests are rebuilt as well (and vice versa).

Netbeans is good at resolving the dependencies for library projects, and rebuilding them if necessary, but I can't see any way of making one application project depend upon another.

I could do this by editing the .build-post rule in the Makefile by hand, but that's a bit ugly.

I suspect adding some magic macros to the Project Properties -> Build -> Debug -> Additional Dependencies dialogue would do what I want, but I can't find any docs for this.

I suppose this is probably a sign that I should switch to Cruise Control to automate the process of building and running my tests...

A: 

Support for this was added in Netbeans 6.7.

Project Properties -> Required Projects -> Select the project and tick "Build".

Note that it won't let you create a cyclic dependency by having two projects Require each other, but you can work around this by creating a dummy Main project that Requires all the projects that you want to build together.

therefromhere