1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmOptionCommand.h,v $
6 Date: $Date: 2008/01/23 15:27:59 $
7 Version: $Revision: 1.16 $
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 cmOptionCommand_h
18 #define cmOptionCommand_h
20 #include "cmCommand.h"
22 /** \class cmOptionCommand
23 * \brief Provide an option to the user
25 * cmOptionCommand provides an option for the user to select
27 class cmOptionCommand
: public cmCommand
31 * This is a virtual constructor for the command.
33 virtual cmCommand
* Clone()
35 return new cmOptionCommand
;
39 * This is called when the command is first encountered in
40 * the CMakeLists.txt file.
42 virtual bool InitialPass(std::vector
<std::string
> const& args
,
43 cmExecutionStatus
&status
);
46 * The name of the command as specified in CMakeList.txt.
48 virtual const char* GetName() {return "option";}
51 * Succinct documentation.
53 virtual const char* GetTerseDocumentation()
55 return "Provides an option that the user can optionally select.";
61 virtual const char* GetFullDocumentation()
64 " option(<option_variable> \"help string describing option\"\n"
66 "Provide an option for the user to select as ON or OFF. If no "
67 "initial value is provided, OFF is used.";
71 * This determines if the command is invoked when in script mode.
73 virtual bool IsScriptable() { return true; }
75 cmTypeMacro(cmOptionCommand
, cmCommand
);