packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmSeparateArgumentsCommand.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 cmSeparateArgumentsCommand_h
13 #define cmSeparateArgumentsCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmSeparateArgumentsCommand
18  * \brief separate_arguments command
19  *
20  * cmSeparateArgumentsCommand implements the separate_arguments CMake command
21  */
22 class cmSeparateArgumentsCommand : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone()
29     {
30     return new cmSeparateArgumentsCommand;
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    * This determines if the command is invoked when in script mode.
42    */
43   virtual bool IsScriptable() const { return true; }
44
45   /**
46    * The name of the command as specified in CMakeList.txt.
47    */
48   virtual const char* GetName() const {return "separate_arguments";}
49
50   /**
51    * Succinct documentation.
52    */
53   virtual const char* GetTerseDocumentation() const
54     {
55     return
56       "Parse space-separated arguments into a semicolon-separated list.";
57     }
58
59   /**
60    * More documentation.
61    */
62   virtual const char* GetFullDocumentation() const
63     {
64     return
65       "  separate_arguments(<var> <UNIX|WINDOWS>_COMMAND \"<args>\")\n"
66       "Parses a unix- or windows-style command-line string \"<args>\" and "
67       "stores a semicolon-separated list of the arguments in <var>.  "
68       "The entire command line must be given in one \"<args>\" argument."
69       "\n"
70       "The UNIX_COMMAND mode separates arguments by unquoted whitespace.  "
71       "It recognizes both single-quote and double-quote pairs.  "
72       "A backslash escapes the next literal character (\\\" is \"); "
73       "there are no special escapes (\\n is just n)."
74       "\n"
75       "The WINDOWS_COMMAND mode parses a windows command-line using the "
76       "same syntax the runtime library uses to construct argv at startup.  "
77       "It separates arguments by whitespace that is not double-quoted.  "
78       "Backslashes are literal unless they precede double-quotes.  "
79       "See the MSDN article \"Parsing C Command-Line Arguments\" for details."
80       "\n"
81       "  separate_arguments(VARIABLE)\n"
82       "Convert the value of VARIABLE to a semi-colon separated list.  "
83       "All spaces are replaced with ';'.  This helps with generating "
84       "command lines.";
85     }
86
87   cmTypeMacro(cmSeparateArgumentsCommand, cmCommand);
88 };
89
90
91
92 #endif