[CMake] Make test an official dependency...

Theodore Papadopoulo Theodore.Papadopoulo at sophia.inria.fr
Wed Oct 21 14:33:33 EDT 2009


 From the documentation of add_dependencies:

Make a top-level target depend on other top-level targets. A top-level 
target is one created by ADD_EXECUTABLE, ADD_LIBRARY, or ADD_CUSTOM_TARGET.
A test is thus not a valid target to add dependencies to.

Often, one wants to build an executable only for the purpose of a test. 
Excluding the executable
from the all target is easy. However,  there seems to be  currently no 
way of indicating that a test
depends on an executable. Would it be possible to add some target name 
to tests ??

If not, would it be at least possible to make "test" (and for what is 
worth "all") some valid targets to
which dependencies can be added ??

Thank's for any hint.


More information about the CMake mailing list