ENH: mark some vars as advanced (and resort the list)
[cmake.git] / Source / cmForEachCommand.h
blobce90a2b64d38c2736ad534d8f7ac910db6c81aea
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmForEachCommand.h,v $
5 Language: C++
6 Date: $Date: 2002-07-17 14:48:05 $
7 Version: $Revision: 1.5 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 cmForEachCommand_h
18 #define cmForEachCommand_h
20 #include "cmStandardIncludes.h"
21 #include "cmCommand.h"
22 #include "cmFunctionBlocker.h"
24 /** \class cmForEachFunctionBlocker
25 * \brief subclass of function blocker
29 class cmForEachFunctionBlocker : public cmFunctionBlocker
31 public:
32 cmForEachFunctionBlocker() {m_Executing = false;}
33 virtual ~cmForEachFunctionBlocker() {}
34 virtual bool IsFunctionBlocked(const char *name,
35 const std::vector<std::string> &args,
36 cmMakefile &mf);
37 virtual bool ShouldRemove(const char *name,
38 const std::vector<std::string> &args,
39 cmMakefile &mf);
40 virtual void ScopeEnded(cmMakefile &mf);
42 virtual int NeedExpandedVariables () { return 0; };
44 std::vector<std::string> m_Args;
45 std::vector<std::string> m_Commands;
46 std::vector<std::vector<std::string> > m_CommandArguments;
47 bool m_Executing;
50 /** \class cmForEachCommand
51 * \brief starts an if block
53 * cmForEachCommand starts an if block
55 class cmForEachCommand : public cmCommand
57 public:
58 /**
59 * This is a virtual constructor for the command.
61 virtual cmCommand* Clone()
63 return new cmForEachCommand;
66 /**
67 * This is called when the command is first encountered in
68 * the CMakeLists.txt file.
70 virtual bool InitialPass(std::vector<std::string> const& args);
72 /**
73 * This determines if the command gets propagated down
74 * to makefiles located in subdirectories.
76 virtual bool IsInherited() {return true;}
78 /**
79 * The name of the command as specified in CMakeList.txt.
81 virtual const char* GetName() { return "FOREACH";}
83 /**
84 * Succinct documentation.
86 virtual const char* GetTerseDocumentation()
88 return "start a foreach loop";
91 /**
92 * More documentation.
94 virtual const char* GetFullDocumentation()
96 return
97 "FOREACH (define arg1 arg2 arg2) Starts a foreach block.";
100 cmTypeMacro(cmForEachCommand, cmCommand);
104 #endif