1
0

get_test_property.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. get_test_property
  2. -----------------
  3. Get a property of the test.
  4. .. code-block:: cmake
  5. get_test_property(<test> <property> [DIRECTORY <dir>] <variable>)
  6. Get a property from the test. The value of the property is stored in
  7. the specified ``<variable>``. If the ``<test>`` is not defined, or the
  8. test property is not found, ``<variable>`` will be set to ``NOTFOUND``.
  9. If the test property was defined to be an ``INHERITED`` property (see
  10. :command:`define_property`), the search will include the relevant parent
  11. scopes, as described for the :command:`define_property` command.
  12. For a list of standard properties you can type
  13. :option:`cmake --help-property-list`.
  14. .. versionadded:: 3.28
  15. Directory scope can be overridden with the following sub-option:
  16. ``DIRECTORY <dir>``
  17. The test property will be read from the ``<dir>`` directory's
  18. scope. CMake must already know about that source directory, either by
  19. having added it through a call to :command:`add_subdirectory` or ``<dir>``
  20. being the top level source directory. Relative paths are treated as
  21. relative to the current source directory. ``<dir>`` may reference a binary
  22. directory.
  23. See Also
  24. ^^^^^^^^
  25. * :command:`define_property`
  26. * the more general :command:`get_property` command