set_property.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. set_property
  2. ------------
  3. Set a named property in a given scope.
  4. ::
  5. set_property(<GLOBAL |
  6. DIRECTORY [dir] |
  7. TARGET [target1 [target2 ...]] |
  8. SOURCE [src1 [src2 ...]] |
  9. TEST [test1 [test2 ...]] |
  10. CACHE [entry1 [entry2 ...]]>
  11. [APPEND] [APPEND_STRING]
  12. PROPERTY <name> [value1 [value2 ...]])
  13. Set one property on zero or more objects of a scope. The first
  14. argument determines the scope in which the property is set. It must
  15. be one of the following:
  16. ``GLOBAL``
  17. Scope is unique and does not accept a name.
  18. ``DIRECTORY``
  19. Scope defaults to the current directory but another
  20. directory (already processed by CMake) may be named by full or
  21. relative path.
  22. ``TARGET``
  23. Scope may name zero or more existing targets.
  24. ``SOURCE``
  25. Scope may name zero or more source files. Note that source
  26. file properties are visible only to targets added in the same
  27. directory (CMakeLists.txt).
  28. ``TEST``
  29. Scope may name zero or more existing tests.
  30. ``CACHE``
  31. Scope must name zero or more cache existing entries.
  32. The required ``PROPERTY`` option is immediately followed by the name of
  33. the property to set. Remaining arguments are used to compose the
  34. property value in the form of a semicolon-separated list. If the
  35. ``APPEND`` option is given the list is appended to any existing property
  36. value. If the ``APPEND_STRING`` option is given the string is append to any
  37. existing property value as string, i.e. it results in a longer string
  38. and not a list of strings.