packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmOptionCommand.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 cmOptionCommand_h
13 #define cmOptionCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmOptionCommand
18  * \brief Provide an option to the user
19  *
20  * cmOptionCommand provides an option for the user to select
21  */
22 class cmOptionCommand : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone()
29     {
30     return new cmOptionCommand;
31     }
32
33   /**
34    * This is called when the command is first encountered in
35    * the CMakeLists.txt file.
36    */
37   virtual bool InitialPass(std::vector<std::string> const& args,
38                            cmExecutionStatus &status);
39
40   /**
41    * The name of the command as specified in CMakeList.txt.
42    */
43   virtual const char* GetName() const {return "option";}
44
45   /**
46    * Succinct documentation.
47    */
48   virtual const char* GetTerseDocumentation() const
49     {
50     return "Provides an option that the user can optionally select.";
51     }
52
53   /**
54    * More documentation.
55    */
56   virtual const char* GetFullDocumentation() const
57     {
58     return
59       "  option(<option_variable> \"help string describing option\"\n"
60       "         [initial value])\n"
61       "Provide an option for the user to select as ON or OFF.  If no "
62       "initial value is provided, OFF is used.\n"
63       "If you have options that depend on the values of other "
64       "options, see the module help for CMakeDependentOption."
65       ;
66     }
67
68   /**
69    * This determines if the command is invoked when in script mode.
70    */
71   virtual bool IsScriptable() const { return true; }
72
73   cmTypeMacro(cmOptionCommand, cmCommand);
74 };
75
76
77
78 #endif