cmAddSubDirectoryCommand.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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(source_dir [binary_dir] \n"
  56. " [EXCLUDE_FROM_ALL])\n"
  57. "Add a subdirectory to the build. The source_dir specifies the "
  58. "directory in which the source CmakeLists.txt and code files are "
  59. "located. If it is a relative "
  60. "path it will be evaluated with respect to the current "
  61. "directory (the typical usage), but it may also be an absolute path. "
  62. "The binary_dir specifies the directory in which to place the output "
  63. "files. If it is a relative path it will be evaluated with respect "
  64. "to the current otuput directory, but it may also be an absolute "
  65. "path. If binary_dir is not specified, the value of source_dir, "
  66. "before expanding any relative path, will be used (the typical usage). "
  67. "The CMakeLists.txt file in the specified source directory will "
  68. "be processed immediately by CMake before processing in the current "
  69. "input file continues beyond this command.\n"
  70. "If the EXCLUDE_FROM_ALL argument is provided then this subdirectory "
  71. "will not be included in build by default. Users will have to "
  72. "explicitly start a build in the generated output directory. "
  73. "This is useful for having cmake create a build system for a "
  74. "set of examples in a project. One would want cmake to generate "
  75. "a single build system for all the examples, but one may not want "
  76. "the targets to show up in the main build system.";
  77. }
  78. cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
  79. };
  80. #endif