cmFunctionBlocker.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 cmListFileFunction& lff,
  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 cmListFileFunction&,
  35. cmMakefile&) {return false;}
  36. /**
  37. * When the end of a CMakeList file is reached this method is called. It
  38. * is not called on the end of an INCLUDE cmake file, just at the end of a
  39. * regular CMakeList file
  40. */
  41. virtual void ScopeEnded(cmMakefile&) {}
  42. virtual ~cmFunctionBlocker() {}
  43. };
  44. #endif