[CMake] Labels on tests defined on another subdirectory

Raffi Enficiaud raffi.enficiaud at mines-paris.org
Tue Sep 18 20:06:59 EDT 2018


Hi,

I just wanted to know if it is possible from a directory to add labels 
on tests defined on a sub-directory (via add_subdirectory).

When I do a set_tests_properties on the tests that were retrieved with 
get_directory_property, cmake says that the test is not found.

Maybe I am missing some syntax there? The following does not work:

get_directory_property(CURRENT_DIRECTORY_TESTS
                                  DIRECTORY ${my_dir}
                                  TESTS)

if(NOT "${CURRENT_DIRECTORY_TESTS}" STREQUAL "")
     set_tests_properties(${CURRENT_DIRECTORY_TESTS} PROPERTIES LABELS 
"some-labels")
endif()


Thanks!
Raffi



More information about the CMake mailing list