1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmVariableRequiresCommand.h,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.15 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmVariableRequiresCommand_h
18 #define cmVariableRequiresCommand_h
20 #include "cmCommand.h"
22 /** \class cmVariableRequiresCommand
23 * \brief Displays a message to the user
26 class cmVariableRequiresCommand
: public cmCommand
30 * This is a virtual constructor for the command.
32 virtual cmCommand
* Clone()
34 return new cmVariableRequiresCommand
;
38 * This is called when the command is first encountered in
39 * the CMakeLists.txt file.
41 virtual bool InitialPass(std::vector
<std::string
> const& args
,
42 cmExecutionStatus
&status
);
45 * The name of the command as specified in CMakeList.txt.
47 virtual const char* GetName() { return "variable_requires";}
50 * Succinct documentation.
52 virtual const char* GetTerseDocumentation()
54 return "Deprecated. Use the if() command instead.";
60 virtual const char* GetFullDocumentation()
63 "Assert satisfaction of an option's required variables.\n"
64 " variable_requires(TEST_VARIABLE RESULT_VARIABLE\n"
65 " REQUIRED_VARIABLE1\n"
66 " REQUIRED_VARIABLE2 ...)\n"
67 "The first argument (TEST_VARIABLE) is the name of the variable to be "
68 "tested, if that variable is false nothing else is done. If "
69 "TEST_VARIABLE is true, then "
70 "the next argument (RESULT_VARIABLE) is a variable that is set to true "
71 "if all the required variables are set. "
72 "The rest of the arguments are variables that must be true or not "
73 "set to NOTFOUND to avoid an error. If any are not true, an error "
77 /** This command is kept for compatibility with older CMake versions. */
78 virtual bool IsDiscouraged()
83 cmTypeMacro(cmVariableRequiresCommand
, cmCommand
);