You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.5 KiB

23 years ago
20 years ago
23 years ago
  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 "cmCommand.h"
  16. /** \class cmVariableRequiresCommand
  17. * \brief Displays a message to the user
  18. *
  19. */
  20. class cmVariableRequiresCommand : public cmCommand
  21. {
  22. public:
  23. /**
  24. * This is a virtual constructor for the command.
  25. */
  26. virtual cmCommand* Clone()
  27. {
  28. return new cmVariableRequiresCommand;
  29. }
  30. /**
  31. * This is called when the command is first encountered in
  32. * the CMakeLists.txt file.
  33. */
  34. virtual bool InitialPass(std::vector<std::string> const& args);
  35. /**
  36. * The name of the command as specified in CMakeList.txt.
  37. */
  38. virtual const char* GetName() { return "variable_requires";}
  39. /**
  40. * Succinct documentation.
  41. */
  42. virtual const char* GetTerseDocumentation()
  43. {
  44. return "Deprecated. Use the if() command instead.";
  45. }
  46. /**
  47. * More documentation.
  48. */
  49. virtual const char* GetFullDocumentation()
  50. {
  51. return
  52. "Assert satisfaction of an option's required variables.\n"
  53. " variable_requires(TEST_VARIABLE RESULT_VARIABLE\n"
  54. " REQUIRED_VARIABLE1\n"
  55. " REQUIRED_VARIABLE2 ...)\n"
  56. "The first argument (TEST_VARIABLE) is the name of the variable to be "
  57. "tested, if that variable is false nothing else is done. If "
  58. "TEST_VARIABLE is true, then "
  59. "the next argument (RESULT_VARIABLE) is a variable that is set to true "
  60. "if all the required variables are set. "
  61. "The rest of the arguments are variables that must be true or not "
  62. "set to NOTFOUND to avoid an error. If any are not true, an error "
  63. "is reported.";
  64. }
  65. /** This command is kept for compatibility with older CMake versions. */
  66. virtual bool IsDiscouraged()
  67. {
  68. return true;
  69. }
  70. cmTypeMacro(cmVariableRequiresCommand, cmCommand);
  71. };
  72. #endif