1
0

cmIncludeRegularExpressionCommand.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 cmIncludeRegularExpressionCommand_h
  14. #define cmIncludeRegularExpressionCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmIncludeRegularExpressionCommand
  17. * \brief Set the regular expression for following #includes.
  18. *
  19. * cmIncludeRegularExpressionCommand is used to specify the regular expression
  20. * used by cmMakeDepend to determine whether to follow a #include file in
  21. * dependency checking.
  22. */
  23. class cmIncludeRegularExpressionCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmIncludeRegularExpressionCommand;
  32. }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. virtual bool InitialPass(std::vector<std::string> const& args);
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() {return "INCLUDE_REGULAR_EXPRESSION";}
  42. /**
  43. * This determines if the command gets propagated down
  44. * to makefiles located in subdirectories.
  45. */
  46. virtual bool IsInherited()
  47. {
  48. return true;
  49. }
  50. /**
  51. * Succinct documentation.
  52. */
  53. virtual const char* GetTerseDocumentation()
  54. {
  55. return "Set the regular expression used for dependency checking.";
  56. }
  57. /**
  58. * More documentation.
  59. */
  60. virtual const char* GetFullDocumentation()
  61. {
  62. return
  63. " INCLUDE_REGULAR_EXPRESSION(regex_match [regex_complain])\n"
  64. "Set the regular expressions used in dependency checking. Only files "
  65. "matching regex_match will be traced as dependencies. Only files "
  66. "matching regex_complain will generate warnings if they cannot be found "
  67. "(standard header paths are not searched). The defaults are:\n"
  68. " regex_match = \"^.*$\" (match everything)\n"
  69. " regex_complain = \"^$\" (match empty string only)";
  70. }
  71. cmTypeMacro(cmIncludeRegularExpressionCommand, cmCommand);
  72. };
  73. #endif