unset.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. unset
  2. -----
  3. Unset a variable, cache variable, or environment variable.
  4. Unset Normal Variable or Cache Entry
  5. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  6. .. code-block:: cmake
  7. unset(<variable> [CACHE | PARENT_SCOPE])
  8. Removes a normal variable from the current scope, causing it
  9. to become undefined. If ``CACHE`` is present, then a cache variable
  10. is removed instead of a normal variable.
  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:: UNSET_NOTE.txt
  15. Unset Environment Variable
  16. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  17. .. code-block:: cmake
  18. unset(ENV{<variable>})
  19. Removes ``<variable>`` from the currently available
  20. :manual:`Environment Variables <cmake-env-variables(7)>`.
  21. Subsequent calls of ``$ENV{<variable>}`` will return the empty string.
  22. This command affects only the current CMake process, not the process
  23. from which CMake was called, nor the system environment at large,
  24. nor the environment of subsequent build or test processes.
  25. See Also
  26. ^^^^^^^^
  27. * :command:`set`