unset.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. unset
  2. -----
  3. Unset a variable, cache variable, or environment variable.
  4. Unset Normal Variable
  5. ^^^^^^^^^^^^^^^^^^^^^
  6. .. signature::
  7. unset(<variable> [PARENT_SCOPE])
  8. :target: normal
  9. Removes a normal variable from the current scope, causing it
  10. to become undefined.
  11. If ``PARENT_SCOPE`` is present then the variable is removed from the scope
  12. above the current scope. See the same option in the :command:`set` command
  13. for further details.
  14. .. include:: include/UNSET_NOTE.rst
  15. Unset Cache Entry
  16. ^^^^^^^^^^^^^^^^^
  17. .. signature::
  18. unset(CACHE{<variable>})
  19. :target: CACHE
  20. .. versionadded:: 4.2
  21. Removes ``<variable>`` from the cache, causing it to become undefined.
  22. .. signature::
  23. unset(<variable> CACHE)
  24. :target: CACHE_legacy
  25. This signature is supported for compatibility purpose. Use preferably the
  26. other one.
  27. Unset Environment Variable
  28. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  29. .. signature::
  30. unset(ENV{<variable>})
  31. :target: ENV
  32. Removes ``<variable>`` from the currently available
  33. :manual:`Environment Variables <cmake-env-variables(7)>`.
  34. Subsequent calls of ``$ENV{<variable>}`` will return the empty string.
  35. This command affects only the current CMake process, not the process
  36. from which CMake was called, nor the system environment at large,
  37. nor the environment of subsequent build or test processes.
  38. See Also
  39. ^^^^^^^^
  40. * :command:`set`