<div dir="ltr">Using command 'get_directory_property(var DIRECTORY ${my_dir} TESTS)' is OK to retrieve tests defined in some sub directory.<div>But, it is useless because command 'set_test_properties()' must be called from the directory where the tests are defined.</div><div><br></div><div>but you can do:</div><div><br></div><div>set (MY_LABELS LABEL1)<br></div><div><br></div><div>add_subdirectory("my_dir")</div><div><br></div><div>and in "my_dir":</div><div><br></div><div>add_test(TEST1 ...)</div><div>set_property(TEST TEST1 APPEND PROPERTY LABELS ${MY_LABELS})</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Le mer. 19 sept. 2018 à 19:45, Raffi Enficiaud <<a href="mailto:raffi.enficiaud@mines-paris.org">raffi.enficiaud@mines-paris.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 19.09.18 08:25, Marc CHEVRIER wrote:<br>
> directory property 'TESTS' returns the tests created in the <br>
> *current* directory only.<br>
> The main reason to this limitation is the fact that tests created in <br>
> different directories can have same name.<br>
<br>
The get_directory_property call is made from the directory that is <br>
calling add_subdirectory, so I am guessing that the property is <br>
available everywhere?<br>
<br>
I would like to modify the labels of some specific tests. Is there a <br>
non-intrusive way to do that? Can I set a variable to inherit this LABEL <br>
before the call to add_subdirectory?<br>
<br>
Thanks!<br>
Raffi<br>
<br>
> <br>
> <br>
> Le mer. 19 sept. 2018 à 02:22, Raffi Enficiaud <br>
> <<a href="mailto:raffi.enficiaud@mines-paris.org" target="_blank">raffi.enficiaud@mines-paris.org</a> <br>
> <mailto:<a href="mailto:raffi.enficiaud@mines-paris.org" target="_blank">raffi.enficiaud@mines-paris.org</a>>> a écrit :<br>
> <br>
>     Hi,<br>
> <br>
>     I just wanted to know if it is possible from a directory to add labels<br>
>     on tests defined on a sub-directory (via add_subdirectory).<br>
> <br>
>     When I do a set_tests_properties on the tests that were retrieved with<br>
>     get_directory_property, cmake says that the test is not found.<br>
> <br>
>     Maybe I am missing some syntax there? The following does not work:<br>
> <br>
>     get_directory_property(CURRENT_DIRECTORY_TESTS<br>
>                                        DIRECTORY ${my_dir}<br>
>                                        TESTS)<br>
> <br>
>     if(NOT "${CURRENT_DIRECTORY_TESTS}" STREQUAL "")<br>
>           set_tests_properties(${CURRENT_DIRECTORY_TESTS} PROPERTIES LABELS<br>
>     "some-labels")<br>
>     endif()<br>
> <br>
> <br>
>     Thanks!<br>
>     Raffi<br>
> <br>
>     -- <br>
> <br>
>     Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a> <<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><br>
> <br>
>     Please keep messages on-topic and check the CMake FAQ at:<br>
>     <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
> <br>
>     Kitware offers various services to support the CMake community. For<br>
>     more information on each offering, please visit:<br>
> <br>
>     CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
>     CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>     CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
> <br>
>     Visit other Kitware open-source projects at<br>
>     <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> <br>
>     Follow this link to subscribe/unsubscribe:<br>
>     <a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
> <br>
> <br>
> <br>
<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>