2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2001-07-25 20:52:51 +00:00
|
|
|
#ifndef cmForEachCommand_h
|
|
|
|
#define cmForEachCommand_h
|
|
|
|
|
2017-08-25 18:39:02 +00:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-04-11 19:42:35 +00:00
|
|
|
|
2016-10-25 18:35:04 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2016-04-29 13:40:20 +00:00
|
|
|
|
2016-10-25 18:35:04 +00:00
|
|
|
#include "cmCommand.h"
|
2001-07-25 20:52:51 +00:00
|
|
|
#include "cmFunctionBlocker.h"
|
2002-12-11 23:13:33 +00:00
|
|
|
#include "cmListFileCache.h"
|
2001-07-25 20:52:51 +00:00
|
|
|
|
2016-10-25 18:35:04 +00:00
|
|
|
class cmExecutionStatus;
|
|
|
|
class cmMakefile;
|
|
|
|
|
2001-07-25 20:52:51 +00:00
|
|
|
class cmForEachFunctionBlocker : public cmFunctionBlocker
|
|
|
|
{
|
|
|
|
public:
|
2015-06-22 15:31:04 +00:00
|
|
|
cmForEachFunctionBlocker(cmMakefile* mf);
|
2017-09-15 13:56:26 +00:00
|
|
|
~cmForEachFunctionBlocker() override;
|
2016-06-27 19:25:27 +00:00
|
|
|
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
|
2017-09-15 13:56:26 +00:00
|
|
|
cmExecutionStatus&) override;
|
|
|
|
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2006-03-15 16:02:08 +00:00
|
|
|
std::vector<std::string> Args;
|
|
|
|
std::vector<cmListFileFunction> Functions;
|
2016-05-16 14:34:04 +00:00
|
|
|
|
2006-05-18 17:50:01 +00:00
|
|
|
private:
|
2015-06-22 15:31:04 +00:00
|
|
|
cmMakefile* Makefile;
|
2006-05-18 17:50:01 +00:00
|
|
|
int Depth;
|
2001-07-25 20:52:51 +00:00
|
|
|
};
|
|
|
|
|
2012-02-27 21:54:43 +00:00
|
|
|
/// Starts foreach() ... endforeach() block
|
2001-07-25 20:52:51 +00:00
|
|
|
class cmForEachCommand : public cmCommand
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
2017-09-15 13:56:26 +00:00
|
|
|
cmCommand* Clone() override { return new cmForEachCommand; }
|
2001-07-25 20:52:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
2016-06-27 19:25:27 +00:00
|
|
|
bool InitialPass(std::vector<std::string> const& args,
|
2017-09-15 13:56:26 +00:00
|
|
|
cmExecutionStatus& status) override;
|
2001-07-25 20:52:51 +00:00
|
|
|
|
2009-03-17 19:10:15 +00:00
|
|
|
private:
|
|
|
|
bool HandleInMode(std::vector<std::string> const& args);
|
2001-07-25 20:52:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|