Updated formatting of documentation plus a little reorganization.
[cmake.git] / Source / cmSeparateArgumentsCommand.h
blob6c445481142f5d121c3834618f10f088a73eb5ff
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmSeparateArgumentsCommand.h,v $
5 Language: C++
6 Date: $Date: 2009-07-14 14:15:44 $
7 Version: $Revision: 1.10 $
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 cmSeparateArgumentsCommand_h
18 #define cmSeparateArgumentsCommand_h
20 #include "cmCommand.h"
22 /** \class cmSeparateArgumentsCommand
23 * \brief SeparateArguments a CMAKE variable
25 * cmSeparateArgumentsCommand sets a variable to a value with expansion.
27 class cmSeparateArgumentsCommand : public cmCommand
29 public:
30 /**
31 * This is a virtual constructor for the command.
33 virtual cmCommand* Clone()
35 return new cmSeparateArgumentsCommand;
38 /**
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);
45 /**
46 * This determines if the command is invoked when in script mode.
48 virtual bool IsScriptable() { return true; }
50 /**
51 * The name of the command as specified in CMakeList.txt.
53 virtual const char* GetName() {return "separate_arguments";}
55 /**
56 * Succinct documentation.
58 virtual const char* GetTerseDocumentation()
60 return
61 "Parse space-separated arguments into a semicolon-separated list.";
64 /**
65 * More documentation.
67 virtual const char* GetFullDocumentation()
69 return
70 " separate_arguments(<var> <UNIX|WINDOWS>_COMMAND \"<args>\")\n"
71 "Parses a unix- or windows-style command-line string \"<args>\" and "
72 "stores a semicolon-separated list of the arguments in <var>. "
73 "The entire command line must be given in one \"<args>\" argument."
74 "\n"
75 "The UNIX_COMMAND mode separates arguments by unquoted whitespace. "
76 "It recognizes both single-quote and double-quote pairs. "
77 "A backslash escapes the next literal character (\\\" is \"); "
78 "there are no special escapes (\\n is just n)."
79 "\n"
80 "The WINDOWS_COMMAND mode parses a windows command-line using the "
81 "same syntax the runtime library uses to construct argv at startup. "
82 "It separates arguments by whitespace that is not double-quoted. "
83 "Backslashes are literal unless they precede double-quotes. "
84 "See the MSDN article \"Parsing C Command-Line Arguments\" for details."
85 "\n"
86 " separate_arguments(VARIABLE)\n"
87 "Convert the value of VARIABLE to a semi-colon separated list. "
88 "All spaces are replaced with ';'. This helps with generating "
89 "command lines.";
92 cmTypeMacro(cmSeparateArgumentsCommand, cmCommand);
97 #endif