cmFunctionCommand.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmFunctionCommand_h
  4. #define cmFunctionCommand_h
  5. #include "cmConfigure.h"
  6. #include <string>
  7. #include <vector>
  8. #include "cmCommand.h"
  9. #include "cmFunctionBlocker.h"
  10. #include "cmListFileCache.h"
  11. class cmExecutionStatus;
  12. class cmMakefile;
  13. class cmFunctionFunctionBlocker : public cmFunctionBlocker
  14. {
  15. public:
  16. cmFunctionFunctionBlocker() { this->Depth = 0; }
  17. ~cmFunctionFunctionBlocker() CM_OVERRIDE {}
  18. bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
  19. cmExecutionStatus&) CM_OVERRIDE;
  20. bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) CM_OVERRIDE;
  21. std::vector<std::string> Args;
  22. std::vector<cmListFileFunction> Functions;
  23. int Depth;
  24. };
  25. /// Starts function() ... endfunction() block
  26. class cmFunctionCommand : public cmCommand
  27. {
  28. public:
  29. /**
  30. * This is a virtual constructor for the command.
  31. */
  32. cmCommand* Clone() CM_OVERRIDE { return new cmFunctionCommand; }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. bool InitialPass(std::vector<std::string> const& args,
  38. cmExecutionStatus& status) CM_OVERRIDE;
  39. /**
  40. * The name of the command as specified in CMakeList.txt.
  41. */
  42. std::string GetName() const CM_OVERRIDE { return "function"; }
  43. };
  44. #endif