1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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
15 #include "cmCommand.h"
17 /** \class cmVariableRequiresCommand
18 * \brief Displays a message to the user
21 class cmVariableRequiresCommand : public cmCommand
25 * This is a virtual constructor for the command.
27 virtual cmCommand* Clone()
29 return new cmVariableRequiresCommand;
33 * This is called when the command is first encountered in
34 * the CMakeLists.txt file.
36 virtual bool InitialPass(std::vector<std::string> const& args,
37 cmExecutionStatus &status);
40 * The name of the command as specified in CMakeList.txt.
42 virtual const char* GetName() const { return "variable_requires";}
45 * Succinct documentation.
47 virtual const char* GetTerseDocumentation() const
49 return "Deprecated. Use the if() command instead.";
55 virtual const char* GetFullDocumentation() const
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 "
72 /** This command is kept for compatibility with older CMake versions. */
73 virtual bool IsDiscouraged() const
78 cmTypeMacro(cmVariableRequiresCommand, cmCommand);