cmFunctionBlocker.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmFunctionBlocker_h
  14. #define cmFunctionBlocker_h
  15. #include "cmStandardIncludes.h"
  16. class cmMakefile;
  17. /** \class cmFunctionBlocker
  18. * \brief A class that defines an interface for blocking cmake functions
  19. *
  20. * This is the superclass for any classes that need to block a cmake function
  21. */
  22. class cmFunctionBlocker
  23. {
  24. public:
  25. /**
  26. * should a function be blocked
  27. */
  28. virtual bool IsFunctionBlocked(const char *name, const std::vector<std::string> &args,
  29. cmMakefile &mf) = 0;
  30. /**
  31. * should this function blocker be removed, useful when one function adds a
  32. * blocker and another must remove it
  33. */
  34. virtual bool ShouldRemove(const char *name,
  35. const std::vector<std::string> &args,
  36. cmMakefile &mf) {return false;}
  37. /**
  38. * When the end of a CMakeList file is reached this method is called. It
  39. * is not called on the end of an INCLUDE cmake file, just at the end of a
  40. * regular CMakeList file
  41. */
  42. virtual void ScopeEnded(cmMakefile &mf) {}
  43. virtual ~cmFunctionBlocker() {}
  44. virtual int NeedExpandedVariables () { return 1; };
  45. };
  46. #endif