[CMake] make test oddity

Scott Amort jsamort at gmail.com
Wed Aug 23 10:41:57 EDT 2006


Hi All,

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
-- subproject2
---- src
---- test
-- subproject3
---- src
---- test

...etc.

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.

I need to delete all files from the (subproject) build directory, re-run
cmake and then do `make test' to get it to work again.  The ctest
command in the Makefile looks correct, and if I add a custom `make
check' target using the same command it works correctly each time.  Has
anyone run across similar behaviour?

Thanks for any assistance,
Scott



More information about the CMake mailing list