cmSourceGroupCommand.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmSourceGroupCommand_h
  11. #define cmSourceGroupCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmSourceGroupCommand
  14. * \brief Adds a cmSourceGroup to the cmMakefile.
  15. *
  16. * cmSourceGroupCommand is used to define cmSourceGroups which split up
  17. * source files in to named, organized groups in the generated makefiles.
  18. */
  19. class cmSourceGroupCommand : public cmCommand
  20. {
  21. public:
  22. /**
  23. * This is a virtual constructor for the command.
  24. */
  25. virtual cmCommand* Clone()
  26. {
  27. return new cmSourceGroupCommand;
  28. }
  29. /**
  30. * This is called when the command is first encountered in
  31. * the CMakeLists.txt file.
  32. */
  33. virtual bool InitialPass(std::vector<std::string> const& args,
  34. cmExecutionStatus &status);
  35. /**
  36. * The name of the command as specified in CMakeList.txt.
  37. */
  38. virtual const char* GetName() const {return "source_group";}
  39. /**
  40. * Succinct documentation.
  41. */
  42. virtual const char* GetTerseDocumentation() const
  43. {
  44. return "Define a grouping for sources in the makefile.";
  45. }
  46. /**
  47. * More documentation.
  48. */
  49. virtual const char* GetFullDocumentation() const
  50. {
  51. return
  52. " source_group(name [REGULAR_EXPRESSION regex] "
  53. "[FILES src1 src2 ...])\n"
  54. "Defines a group into which sources will be placed in project files. "
  55. "This is mainly used to setup file tabs in Visual Studio. "
  56. "Any file whose name is listed or matches the regular expression will "
  57. "be placed in this group. If a file matches multiple groups, the LAST "
  58. "group that explicitly lists the file will be favored, if any. If no "
  59. "group explicitly lists the file, the LAST group whose regular "
  60. "expression matches the file will be favored.\n"
  61. "The name of the group may contain backslashes to specify subgroups:\n"
  62. " source_group(outer\\\\inner ...)\n"
  63. "For backwards compatibility, this command also supports the "
  64. "format:\n"
  65. " source_group(name regex)";
  66. }
  67. cmTypeMacro(cmSourceGroupCommand, cmCommand);
  68. };
  69. #endif