[CMake] test dependencies

David Cole david.cole at kitware.com
Fri Mar 12 17:10:16 EST 2010


If you use set_property instead, there's an APPEND mode to make this easier:

set_property(TEST test3 APPEND PROPERTY DEPENDS test2)
set_property(TEST test3 APPEND PROPERTY DEPENDS test1)

I think you can do it with set_tests_properties, too, like this:
SET_TESTS_PROPERTIES(test3 PROPERTIES DEPENDS "test1;test2")

...but I would recommend set_property with APPEND.


HTH,
David


On Fri, Mar 12, 2010 at 4:42 PM, Alexandre Gramfort <
alexandre.gramfort at inria.fr> wrote:

> Hi,
>
> I don't manage to have a test depend on multiple tests.
>
> If I do :
>
> SET_TESTS_PROPERTIES(test3 PROPERTIES DEPENDS test2)
> SET_TESTS_PROPERTIES(test3 PROPERTIES DEPENDS test1)
>
> test3 only depends on test1
>
> and
>
> SET_TESTS_PROPERTIES(test3 PROPERTIES DEPENDS test1 test2)
>
> is not a valid syntax.
>
> SET_TESTS_PROPERTIES(test3 PROPERTIES DEPENDS "test1 test2")
>
> do not work either
>
> Any idea?
>
> Thanks
> Alexandre
>
> 2010/3/12 Alexander Neundorf <a.neundorf-work at gmx.net>:
> > On Friday 12 March 2010, David Cole wrote:
> >> ctest -R "test1|test2" ?
> >>
> >> Using -R says "run only the tests that match this regex" -- it does not
> say
> >> "run the matching tests after running all the tests they depend on
> >> first"...
> >
> > Well, OTOH if I do "make some_target" with cmake-generated makefiles it
> will
> > build all targets some_target depends on first ;-)
> > You know, people have become to expect that cmake always does things in
> the
> > best possible way :-)
> >
> > Alex
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100312/13959fe5/attachment.htm>


More information about the CMake mailing list