cmSourceGroupCommand.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 regex)\n"
  64. "Defines a new source group. Any file whose name matches the regular\n"
  65. "expression will be placed in this group. The LAST regular expression\n"
  66. "of all defined SOURCE_GROUPs that matches the file will be selected.";
  67. }
  68. cmTypeMacro(cmSourceGroupCommand, cmCommand);
  69. };
  70. #endif