cmSubdirCommand.h 3.0 KB

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