1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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
15 #include "cmCommand.h"
17 /** \class cmSourceGroupCommand
18 * \brief Adds a cmSourceGroup to the cmMakefile.
20 * cmSourceGroupCommand is used to define cmSourceGroups which split up
21 * source files in to named, organized groups in the generated makefiles.
23 class cmSourceGroupCommand : public cmCommand
27 * This is a virtual constructor for the command.
29 virtual cmCommand* Clone()
31 return new cmSourceGroupCommand;
35 * This is called when the command is first encountered in
36 * the CMakeLists.txt file.
38 virtual bool InitialPass(std::vector<std::string> const& args,
39 cmExecutionStatus &status);
42 * The name of the command as specified in CMakeList.txt.
44 virtual const char* GetName() const {return "source_group";}
47 * Succinct documentation.
49 virtual const char* GetTerseDocumentation() const
51 return "Define a grouping for sources in the makefile.";
57 virtual const char* GetFullDocumentation() const
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 "
73 " source_group(name regex)";
76 cmTypeMacro(cmSourceGroupCommand, cmCommand);