1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmReturnCommand.h,v $
6 Date: $Date: 2008-08-16 22:06:17 $
7 Version: $Revision: 1.3 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmReturnCommand_h
18 #define cmReturnCommand_h
20 #include "cmCommand.h"
22 /** \class cmReturnCommand
23 * \brief Return from a directory or function
25 * cmReturnCommand returns from a directory or function
27 class cmReturnCommand
: public cmCommand
31 * This is a virtual constructor for the command.
33 virtual cmCommand
* Clone()
35 return new cmReturnCommand
;
39 * This is called when the command is first encountered in
40 * the CMakeLists.txt file.
42 virtual bool InitialPass(std::vector
<std::string
> const& args
,
43 cmExecutionStatus
&status
);
46 * This determines if the command is invoked when in script mode.
48 virtual bool IsScriptable() { return true; }
51 * The name of the command as specified in CMakeList.txt.
53 virtual const char* GetName() {return "return";}
56 * Succinct documentation.
58 virtual const char* GetTerseDocumentation()
60 return "Return from a file, directory or function.";
66 virtual const char* GetFullDocumentation()
70 "Returns from a file, directory or function. When this command is "
71 "encountered in an included file (via include() or find_package()), "
72 "it causes processing of the current file to stop and control is "
73 "returned to the including file. If it is encountered in a file which "
74 "is not included by another file, e.g. a CMakeLists.txt, control is "
75 "returned to the parent directory if there is one. "
76 "If return is called in a function, control is returned to the caller "
77 "of the function. Note that a macro "
78 "is not a function and does not handle return like a function does.";
81 cmTypeMacro(cmReturnCommand
, cmCommand
);