cmSourceFilesRequireRule.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 cmSourceFilesRequireRule_h
  12. #define cmSourceFilesRequireRule_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmRuleMaker.h"
  15. /** \class cmSourceFilesRequireRule
  16. * \brief Add additional sources to the build if certain required files
  17. * or CMake variables are defined.
  18. *
  19. * cmSourceFilesRequireRule conditionally adds source files to the
  20. * build if the specified files of CMake variables are defined.
  21. * This rule can be used to add source files that depend on external
  22. * packages or operating system features.
  23. */
  24. class cmSourceFilesRequireRule : public cmRuleMaker
  25. {
  26. public:
  27. /**
  28. * This is a virtual constructor for the rule.
  29. */
  30. virtual cmRuleMaker* Clone()
  31. {
  32. return new cmSourceFilesRequireRule;
  33. }
  34. /**
  35. * This is called when the rule is first encountered in
  36. * the CMakeLists.txt file.
  37. */
  38. virtual bool Invoke(std::vector<std::string>& args);
  39. /**
  40. * This is called at the end after all the information
  41. * specified by the rules is accumulated.
  42. */
  43. virtual void FinalPass() { }
  44. /**
  45. * The name of the rule as specified in CMakeList.txt.
  46. */
  47. virtual const char* GetName() { return "SOURCE_FILES_REQUIRE";}
  48. /**
  49. * Succinct documentation.
  50. */
  51. virtual const char* TerseDocumentation()
  52. {
  53. return "Add a list of source files if the required variables are set.";
  54. }
  55. /**
  56. * More documentation.
  57. */
  58. virtual const char* FullDocumentation()
  59. {
  60. return
  61. "SOURCE_FILES_REQUIRE(var1 var2 ... SOURCES_BEGIN file1 file2 ...)";
  62. }
  63. };
  64. #endif