get_property.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. get_property
  2. ------------
  3. Get a property.
  4. ::
  5. get_property(<variable>
  6. <GLOBAL |
  7. DIRECTORY [dir] |
  8. TARGET <target> |
  9. SOURCE <source> |
  10. TEST <test> |
  11. CACHE <entry> |
  12. VARIABLE>
  13. PROPERTY <name>
  14. [SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
  15. Get one property from one object in a scope. The first argument
  16. specifies the variable in which to store the result. The second
  17. argument determines the scope from which to get the property. It must
  18. be one of the following:
  19. GLOBAL scope is unique and does not accept a name.
  20. DIRECTORY scope defaults to the current directory but another
  21. directory (already processed by CMake) may be named by full or
  22. relative path.
  23. TARGET scope must name one existing target.
  24. SOURCE scope must name one source file.
  25. TEST scope must name one existing test.
  26. CACHE scope must name one cache entry.
  27. VARIABLE scope is unique and does not accept a name.
  28. The required PROPERTY option is immediately followed by the name of
  29. the property to get. If the property is not set an empty value is
  30. returned. If the SET option is given the variable is set to a boolean
  31. value indicating whether the property has been set. If the DEFINED
  32. option is given the variable is set to a boolean value indicating
  33. whether the property has been defined such as with define_property.
  34. If BRIEF_DOCS or FULL_DOCS is given then the variable is set to a
  35. string containing documentation for the requested property. If
  36. documentation is requested for a property that has not been defined
  37. NOTFOUND is returned.