cmVariableRequiresCommand.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 cmVariableRequiresCommand_h
  14. #define cmVariableRequiresCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmVariableRequiresCommand
  18. * \brief Displays a message to the user
  19. *
  20. */
  21. class cmVariableRequiresCommand : public cmCommand
  22. {
  23. public:
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmVariableRequiresCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args);
  36. ///!
  37. virtual void FinalPass();
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() { return "VARIABLE_REQUIRES";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Display an error message .";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. "VARIABLE_REQUIRES(TEST_VARIABLE RESULT_VARIABLE "
  56. "REQUIRED_VARIABLE1 REQUIRED_VARIABLE2 ...) "
  57. "The first argument (TEST_VARIABLE) is the name of the varible to be "
  58. "tested, if that varible is false nothing else is done. If "
  59. "TEST_VARIABLE is true, then "
  60. "the next arguemnt (RESULT_VARIABLE) is a vairable that is set to true "
  61. "if all the "
  62. "required variables are set."
  63. "The rest of the arguments are varibles that must be true or not "
  64. "set to NOTFOUND to avoid an error. ";
  65. }
  66. cmTypeMacro(cmVariableRequiresCommand, cmCommand);
  67. private:
  68. std::string m_ErrorMessage;
  69. std::vector<std::string> m_Arguments;
  70. bool m_RequirementsMet;
  71. };
  72. #endif