packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmVariableRequiresCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #ifndef cmVariableRequiresCommand_h
13 #define cmVariableRequiresCommand_h
14
15 #include "cmCommand.h"
16
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   /**
33    * This is called when the command is first encountered in
34    * the CMakeLists.txt file.
35    */
36   virtual bool InitialPass(std::vector<std::string> const& args,
37                            cmExecutionStatus &status);
38
39   /**
40    * The name of the command as specified in CMakeList.txt.
41    */
42   virtual const char* GetName() const { return "variable_requires";}
43
44   /**
45    * Succinct documentation.
46    */
47   virtual const char* GetTerseDocumentation() const
48     {
49     return "Deprecated. Use the if() command instead.";
50     }
51
52   /**
53    * More documentation.
54    */
55   virtual const char* GetFullDocumentation() const
56     {
57     return
58       "Assert satisfaction of an option's required variables.\n"
59       "  variable_requires(TEST_VARIABLE RESULT_VARIABLE\n"
60       "                    REQUIRED_VARIABLE1\n"
61       "                    REQUIRED_VARIABLE2 ...)\n"
62       "The first argument (TEST_VARIABLE) is the name of the variable to be "
63       "tested, if that variable is false nothing else is done. If "
64       "TEST_VARIABLE is true, then "
65       "the next argument (RESULT_VARIABLE) is a variable that is set to true "
66       "if all the required variables are set. "
67       "The rest of the arguments are variables that must be true or not "
68       "set to NOTFOUND to avoid an error.  If any are not true, an error "
69       "is reported.";
70     }
71
72   /** This command is kept for compatibility with older CMake versions. */
73   virtual bool IsDiscouraged() const
74     {
75     return true;
76     }
77
78   cmTypeMacro(cmVariableRequiresCommand, cmCommand);
79 };
80
81
82 #endif