1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmReturnCommand_h
13 #define cmReturnCommand_h
15 #include "cmCommand.h"
17 /** \class cmReturnCommand
18 * \brief Return from a directory or function
20 * cmReturnCommand returns from a directory or function
22 class cmReturnCommand : public cmCommand
26 * This is a virtual constructor for the command.
28 virtual cmCommand* Clone()
30 return new cmReturnCommand;
34 * This is called when the command is first encountered in
35 * the CMakeLists.txt file.
37 virtual bool InitialPass(std::vector<std::string> const& args,
38 cmExecutionStatus &status);
41 * This determines if the command is invoked when in script mode.
43 virtual bool IsScriptable() const { return true; }
46 * The name of the command as specified in CMakeList.txt.
48 virtual const char* GetName() const {return "return";}
51 * Succinct documentation.
53 virtual const char* GetTerseDocumentation() const
55 return "Return from a file, directory or function.";
61 virtual const char* GetFullDocumentation() const
65 "Returns from a file, directory or function. When this command is "
66 "encountered in an included file (via include() or find_package()), "
67 "it causes processing of the current file to stop and control is "
68 "returned to the including file. If it is encountered in a file which "
69 "is not included by another file, e.g. a CMakeLists.txt, control is "
70 "returned to the parent directory if there is one. "
71 "If return is called in a function, control is returned to the caller "
72 "of the function. Note that a macro "
73 "is not a function and does not handle return like a function does.";
76 cmTypeMacro(cmReturnCommand, cmCommand);