cmAddSubDirectoryCommand.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 cmAddSubDirectoryCommand_h
  14. #define cmAddSubDirectoryCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmAddSubDirectoryCommand
  17. * \brief Specify a subdirectory to build
  18. *
  19. * cmAddSubDirectoryCommand specifies a subdirectory to process
  20. * by CMake. CMake will descend
  21. * into the specified source directory and process any CMakeLists.txt found.
  22. */
  23. class cmAddSubDirectoryCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmAddSubDirectoryCommand;
  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 "ADD_SUBDIRECTORY";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Add a subdirectory to the build.";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. " ADD_SUBDIRECTORY(binary_dir [source_dir]\n"
  56. " [EXCLUDE_FROM_ALL])\n"
  57. "Add a subdirectory to the build. The binary_dir specifies the "
  58. "directory in which to store the build files. If it is a relative "
  59. "path it will be evaluated with respect to the current output "
  60. "directory (the typical usage), but it may also be an absolute path. "
  61. "The source_dir specifies the directory in which to find the source "
  62. "files. If it is a relative path it will be evaluated with respect "
  63. "to the current source directory, but it may also be an absolute "
  64. "path. If source_dir is not specified the value of binary_dir, "
  65. "before expanding any relative path, will be used (the typical usage). "
  66. "The CMakeLists.txt file in the specified source directory will "
  67. "be processed immediately by CMake before processing in the current "
  68. "input file continues beyond this command.\n"
  69. "If the EXCLUDE_FROM_ALL argument is provided then this subdirectory "
  70. "will not be included in build by default. Users will have to "
  71. "explicitly start a build in the generated output directory. "
  72. "This is useful for having cmake create a build system for a "
  73. "set of examples in a project. One would want cmake to generate "
  74. "a single build system for all the examples, but one may not want "
  75. "the targets to show up in the main build system.";
  76. }
  77. cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
  78. };
  79. #endif