define_property.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. define_property
  2. ---------------
  3. Define and document custom properties.
  4. ::
  5. define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
  6. TEST | VARIABLE | CACHED_VARIABLE>
  7. PROPERTY <name> [INHERITED]
  8. BRIEF_DOCS <brief-doc> [docs...]
  9. FULL_DOCS <full-doc> [docs...])
  10. Define one property in a scope for use with the set_property and
  11. get_property commands. This is primarily useful to associate
  12. documentation with property names that may be retrieved with the
  13. get_property command. The first argument determines the kind of scope
  14. in which the property should be used. It must be one of the
  15. following:
  16. ::
  17. GLOBAL = associated with the global namespace
  18. DIRECTORY = associated with one directory
  19. TARGET = associated with one target
  20. SOURCE = associated with one source file
  21. TEST = associated with a test named with add_test
  22. VARIABLE = documents a CMake language variable
  23. CACHED_VARIABLE = documents a CMake cache variable
  24. Note that unlike set_property and get_property no actual scope needs
  25. to be given; only the kind of scope is important.
  26. The required PROPERTY option is immediately followed by the name of
  27. the property being defined.
  28. If the INHERITED option then the get_property command will chain up to
  29. the next higher scope when the requested property is not set in the
  30. scope given to the command. DIRECTORY scope chains to GLOBAL.
  31. TARGET, SOURCE, and TEST chain to DIRECTORY.
  32. The BRIEF_DOCS and FULL_DOCS options are followed by strings to be
  33. associated with the property as its brief and full documentation.
  34. Corresponding options to the get_property command will retrieve the
  35. documentation.