return.rst 731 B

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