Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmSourceGroupCommand.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 cmSourceGroupCommand_h
13 #define cmSourceGroupCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmSourceGroupCommand
18  * \brief Adds a cmSourceGroup to the cmMakefile.
19  *
20  * cmSourceGroupCommand is used to define cmSourceGroups which split up
21  * source files in to named, organized groups in the generated makefiles.
22  */
23 class cmSourceGroupCommand : public cmCommand
24 {
25 public:
26   /**
27    * This is a virtual constructor for the command.
28    */
29   virtual cmCommand* Clone()
30     {
31     return new cmSourceGroupCommand;
32     }
33
34   /**
35    * This is called when the command is first encountered in
36    * the CMakeLists.txt file.
37    */
38   virtual bool InitialPass(std::vector<std::string> const& args,
39                            cmExecutionStatus &status);
40
41   /**
42    * The name of the command as specified in CMakeList.txt.
43    */
44   virtual const char* GetName() const {return "source_group";}
45
46   /**
47    * Succinct documentation.
48    */
49   virtual const char* GetTerseDocumentation() const
50     {
51     return "Define a grouping for sources in the makefile.";
52     }
53
54   /**
55    * More documentation.
56    */
57   virtual const char* GetFullDocumentation() const
58     {
59     return
60       "  source_group(name [REGULAR_EXPRESSION regex] "
61       "[FILES src1 src2 ...])\n"
62       "Defines a group into which sources will be placed in project files.  "
63       "This is mainly used to setup file tabs in Visual Studio.  "
64       "Any file whose name is listed or matches the regular expression will "
65       "be placed in this group.  If a file matches multiple groups, the LAST "
66       "group that explicitly lists the file will be favored, if any.  If no "
67       "group explicitly lists the file, the LAST group whose regular "
68       "expression matches the file will be favored.\n"
69       "The name of the group may contain backslashes to specify subgroups:\n"
70       "  source_group(outer\\\\inner ...)\n"
71       "For backwards compatibility, this command also supports the "
72       "format:\n"
73       "  source_group(name regex)";
74     }
75
76   cmTypeMacro(cmSourceGroupCommand, cmCommand);
77 };
78
79
80
81 #endif