cmSubdirCommand.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 cmSubdirCommand_h
  11. #define cmSubdirCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmSubdirCommand
  14. * \brief Specify a list of subdirectories to build.
  15. *
  16. * cmSubdirCommand specifies a list of subdirectories to process
  17. * by CMake. For each subdirectory listed, CMake will descend
  18. * into that subdirectory and process any CMakeLists.txt found.
  19. */
  20. class cmSubdirCommand : public cmCommand
  21. {
  22. public:
  23. /**
  24. * This is a virtual constructor for the command.
  25. */
  26. virtual cmCommand* Clone()
  27. {
  28. return new cmSubdirCommand;
  29. }
  30. /**
  31. * This is called when the command is first encountered in
  32. * the CMakeLists.txt file.
  33. */
  34. virtual bool InitialPass(std::vector<std::string> const& args,
  35. cmExecutionStatus &status);
  36. /**
  37. * The name of the command as specified in CMakeList.txt.
  38. */
  39. virtual const char* GetName() { return "subdirs";}
  40. /**
  41. * Succinct documentation.
  42. */
  43. virtual const char* GetTerseDocumentation()
  44. {
  45. return "Deprecated. Use the add_subdirectory() command instead.";
  46. }
  47. /**
  48. * More documentation.
  49. */
  50. virtual const char* GetFullDocumentation()
  51. {
  52. return
  53. "Add a list of subdirectories to the build.\n"
  54. " subdirs(dir1 dir2 ..."
  55. "[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]\n"
  56. " [PREORDER] )\n"
  57. "Add a list of subdirectories to the build. The add_subdirectory "
  58. "command should be used instead of subdirs although subdirs will "
  59. "still work. "
  60. "This will cause any CMakeLists.txt files in the sub directories "
  61. "to be processed by CMake. Any directories after the PREORDER flag "
  62. "are traversed first by makefile builds, the PREORDER flag has no "
  63. "effect on IDE projects. "
  64. " Any directories after the EXCLUDE_FROM_ALL marker "
  65. "will not be included in the top level makefile or project file. "
  66. "This is useful for having CMake create makefiles or projects for "
  67. "a set of examples in a project. You would want CMake to "
  68. "generate makefiles or project files for all the examples at "
  69. "the same time, but you would not want them to show up in the "
  70. "top level project or be built each time make is run from the top.";
  71. }
  72. /** This command is kept for compatibility with older CMake versions. */
  73. virtual bool IsDiscouraged()
  74. {
  75. return true;
  76. }
  77. cmTypeMacro(cmSubdirCommand, cmCommand);
  78. };
  79. #endif