1return
2------
3
4Return from a file, directory or function.
5
6.. code-block:: cmake
7
8  return()
9
10Returns from a file, directory or function.  When this command is
11encountered in an included file (via :command:`include` or
12:command:`find_package`), it causes processing of the current file to stop
13and control is returned to the including file.  If it is encountered in a
14file which is not included by another file, e.g.  a ``CMakeLists.txt``,
15deferred calls scheduled by :command:`cmake_language(DEFER)` are invoked and
16control is returned to the parent directory if there is one.  If return is
17called in a function, control is returned to the caller of the function.
18
19Note that a :command:`macro <macro>`, unlike a :command:`function <function>`,
20is expanded in place and therefore cannot handle ``return()``.
21