[CMake] Re: 'make test' fails on x86/Solaris

Matthew Woehlke mw_triad at users.sourceforge.net
Fri Mar 16 15:30:24 EST 2007


Alan W. Irwin wrote:
> If you always remember to run "make" (or the equivalent "make all") before
> "make test" then you have worked around the dependency issue I found, and
> indeed you seem to have found an additional bug (a discrepancy between
> running make test and ctest). which is not relevant to that dependency
> issue.
> 
> However, CMake/CTest users should not have to always remember to do the
> workaround so that is why I reported the dependency issue as bug 4615.

Ok, that makes sense. We agree that this is a different issue than the 
bug I reported. :-)

To reply to your other post, I would think it is sufficient to make 
'test' depend on the programs that are actually being run as part of the 
test. That way the build dependency chains would automatically pull in 
dependencies on any libraries needed to run them (and if they don't, 
it's probably due to User Error :-)). I just checked this in my own 
project and it seems OK. I have a test 'basic' a few levels down; if I 
'make clean' at the top level, cd to where 'basic' lives and 'make 
basic', it successfully builds the libraries that 'basic' depends on.

Where it gets tricky is that I don't ADD_TEST(basic basic), I refer to 
the executable as '{CMAKE_BINARY_DIRECTORY}/path/to/basic'. (Of course, 
I just now realized that '{CMAKE_CURRENT_BINARY_DIR}/basic' also works 
and switched to that :-).) So maybe ADD_TEST needs a DEPENDS keyword?

-- 
Matthew
"Have you tried that new mixed drink, 'GDR'"?
"What is it?"
"Gin, Duck and Rum. It tastes fowl."



More information about the CMake mailing list