cmFindProgramRule.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 cmFindProgramRule_h
  12. #define cmFindProgramRule_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmRuleMaker.h"
  15. /** \class cmFindProgramRule
  16. * \brief Define a rule to search for an executable program.
  17. *
  18. * cmFindProgramRule is used to define a CMake variable
  19. * that specifies an executable program. The rule searches
  20. * in the current path (e.g., PATH environment variable) for
  21. * an executable that matches one of the supplied names.
  22. */
  23. class cmFindProgramRule : public cmRuleMaker
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the rule.
  28. */
  29. virtual cmRuleMaker* Clone()
  30. {
  31. return new cmFindProgramRule;
  32. }
  33. /**
  34. * This is called when the rule is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. virtual bool Invoke(std::vector<std::string>& args);
  38. /**
  39. * This is called at the end after all the information
  40. * specified by the rules is accumulated.
  41. */
  42. virtual void FinalPass() { }
  43. /**
  44. * This determines if the rule gets propagated down
  45. * to makefiles located in subdirectories.
  46. */
  47. virtual bool IsInherited() { return true; }
  48. /**
  49. * The name of the rule as specified in CMakeList.txt.
  50. */
  51. virtual const char* GetName() { return "FIND_PROGRARM";}
  52. /**
  53. * Succinct documentation.
  54. */
  55. virtual const char* GetTerseDocumentation()
  56. {
  57. return "Find an executable program.";
  58. }
  59. /**
  60. * More documentation.
  61. */
  62. virtual const char* GetFullDocumentation()
  63. {
  64. return
  65. "FIND_PROGRAM(NAME executable1 executable2 ...)";
  66. }
  67. };
  68. #endif