cmIfCommand.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #ifndef cmIfCommand_h
  12. #define cmIfCommand_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmCommand.h"
  15. #include "cmFunctionBlocker.h"
  16. /** \class cmIfFunctionBlocker
  17. * \brief subclass of function blocker
  18. *
  19. *
  20. */
  21. class cmIfFunctionBlocker : public cmFunctionBlocker
  22. {
  23. public:
  24. virtual ~cmIfFunctionBlocker() {}
  25. virtual bool IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
  26. const cmMakefile &mf) const;
  27. virtual bool ShouldRemove(const char *name, const std::vector<std::string> &args,
  28. const cmMakefile &mf) const;
  29. std::string m_Define;
  30. };
  31. /** \class cmIfCommand
  32. * \brief starts an if block
  33. *
  34. * cmIfCommand starts an if block
  35. */
  36. class cmIfCommand : public cmCommand
  37. {
  38. public:
  39. /**
  40. * This is a virtual constructor for the command.
  41. */
  42. virtual cmCommand* Clone()
  43. {
  44. return new cmIfCommand;
  45. }
  46. /**
  47. * This is called when the command is first encountered in
  48. * the CMakeLists.txt file.
  49. */
  50. virtual bool Invoke(std::vector<std::string>& args);
  51. /**
  52. * The name of the command as specified in CMakeList.txt.
  53. */
  54. virtual const char* GetName() { return "IF";}
  55. /**
  56. * Succinct documentation.
  57. */
  58. virtual const char* GetTerseDocumentation()
  59. {
  60. return "start an if block";
  61. }
  62. /**
  63. * More documentation.
  64. */
  65. virtual const char* GetFullDocumentation()
  66. {
  67. return
  68. "IF(define)";
  69. }
  70. cmTypeMacro(cmIfCommand, cmCommand);
  71. };
  72. #endif