set_property.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 scope is unique and does not accept a name.
  17. DIRECTORY scope defaults to the current directory but another
  18. directory (already processed by CMake) may be named by full or
  19. relative path.
  20. TARGET scope may name zero or more existing targets.
  21. SOURCE scope may name zero or more source files. Note that source
  22. file properties are visible only to targets added in the same
  23. directory (CMakeLists.txt).
  24. TEST scope may name zero or more existing tests.
  25. CACHE scope must name zero or more cache existing entries.
  26. The required PROPERTY option is immediately followed by the name of
  27. the property to set. Remaining arguments are used to compose the
  28. property value in the form of a semicolon-separated list. If the
  29. APPEND option is given the list is appended to any existing property
  30. value.If the APPEND_STRING option is given the string is append to any
  31. existing property value as string, i.e. it results in a longer string
  32. and not a list of strings.