cmSourceGroupCommand.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmSourceGroupCommand_h
  14. #define cmSourceGroupCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  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. * 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. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() {return "SOURCE_GROUP";}
  42. /**
  43. * This determines if the command gets propagated down
  44. * to makefiles located in subdirectories.
  45. */
  46. virtual bool IsInherited()
  47. {
  48. return true;
  49. }
  50. /**
  51. * Succinct documentation.
  52. */
  53. virtual const char* GetTerseDocumentation()
  54. {
  55. return "Define a grouping for sources in the makefile.";
  56. }
  57. /**
  58. * More documentation.
  59. */
  60. virtual const char* GetFullDocumentation()
  61. {
  62. return
  63. " SOURCE_GROUP(name [REGULAR_EXPRESSION regex] [FILES src1 src2 ...])\n"
  64. "Defines a group into which sources will be placed in project files. "
  65. "This is mainly used to setup file tabs in Visual Studio. "
  66. "Any file whose name is listed or matches the regular expression will "
  67. "be placed in this group. If a file matches multiple groups, the LAST "
  68. "group that explicitly lists the file will be favored, if any. If no "
  69. "group explicitly lists the file, the LAST group whose regular "
  70. "expression matches the file will be favored. For backwards compatibility,"
  71. "this command is also supports the format SOURCE_GROUP(name regex).";
  72. }
  73. cmTypeMacro(cmSourceGroupCommand, cmCommand);
  74. };
  75. #endif