[CMake] make test oddity

Brad King brad.king at kitware.com
Wed Aug 23 11:12:43 EDT 2006


Scott Amort wrote:
> I have come across some strange behaviour with testing and my CMake
> files.  My project is structured like this:
> 
> main project
> -- src
> -- test
> -- subproject1
> ---- src
> ---- test
[snip]
> The idea is that the main project builds all the subprojects first, then
> itself; or, a user can change into one of the subproject directories and
> just build that particular subproject.  It works fine, except for
> testing ( which I have enabled using ENABLE_TESTING() ).  What I have
> observed is that `make test' works as expected if executed from the main
> project, but not if it is run from one of the subprojects.  There it
> only executes ctest once.  Subsequent calls to `make test' do not do
> anything, or result in a:
> 
> make: `test' is up to date.

Your "make" program is finding the "test" directory on disk and assumes
the target is up to date.  Don't call the directory "test".

-Brad


More information about the CMake mailing list