cmUnixDefinesRule.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 cmUnixDefinesRule_h
  12. #define cmUnixDefinesRule_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmRuleMaker.h"
  15. /** \class cmUnixDefinesRule
  16. * \brief Specify a list of compiler defines for Unix platforms.
  17. *
  18. * cmUnixDefinesRule specifies a list of compiler defines for Unix platforms
  19. * only. This defines will be added to the compile command.
  20. */
  21. class cmUnixDefinesRule : public cmRuleMaker
  22. {
  23. public:
  24. /**
  25. * Constructor.
  26. */
  27. cmUnixDefinesRule();
  28. /**
  29. * This is a virtual constructor for the rule.
  30. */
  31. virtual cmRuleMaker* Clone()
  32. {
  33. return new cmUnixDefinesRule;
  34. }
  35. /**
  36. * This is called when the rule is first encountered in
  37. * the CMakeLists.txt file.
  38. */
  39. virtual bool Invoke(std::vector<std::string>& args);
  40. /**
  41. * This is called at the end after all the information
  42. * specified by the rules is accumulated.
  43. */
  44. virtual void FinalPass() { }
  45. /**
  46. * This determines if the rule gets propagated down
  47. * to makefiles located in subdirectories.
  48. */
  49. virtual bool IsInherited() {return true;}
  50. /**
  51. * The name of the rule as specified in CMakeList.txt.
  52. */
  53. virtual const char* GetName() { return "UNIX_DEFINES";}
  54. /**
  55. * Succinct documentation.
  56. */
  57. virtual const char* TerseDocumentation()
  58. {
  59. return "Add -D flags to the command line for Unix only.";
  60. }
  61. /**
  62. * More documentation.
  63. */
  64. virtual const char* FullDocumentation()
  65. {
  66. return
  67. "Add -D flags to the command line for Unix only.\n"
  68. "UNIX_DEFINES(-DFOO -DBAR)";
  69. }
  70. };
  71. #endif