packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmAddSubDirectoryCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #ifndef cmAddSubDirectoryCommand_h
13 #define cmAddSubDirectoryCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmAddSubDirectoryCommand
18  * \brief Specify a subdirectory to build
19  *
20  * cmAddSubDirectoryCommand specifies a subdirectory to process
21  * by CMake. CMake will descend
22  * into the specified source directory and process any CMakeLists.txt found.
23  */
24 class cmAddSubDirectoryCommand : public cmCommand
25 {
26 public:
27   /**
28    * This is a virtual constructor for the command.
29    */
30   virtual cmCommand* Clone()
31     {
32     return new cmAddSubDirectoryCommand;
33     }
34
35   /**
36    * This is called when the command is first encountered in
37    * the CMakeLists.txt file.
38    */
39   virtual bool InitialPass(std::vector<std::string> const& args,
40                            cmExecutionStatus &status);
41
42   /**
43    * The name of the command as specified in CMakeList.txt.
44    */
45   virtual const char* GetName() const { return "add_subdirectory";}
46
47   /**
48    * Succinct documentation.
49    */
50   virtual const char* GetTerseDocumentation() const
51     {
52     return "Add a subdirectory to the build.";
53     }
54
55   /**
56    * More documentation.
57    */
58   virtual const char* GetFullDocumentation() const
59     {
60     return
61       "  add_subdirectory(source_dir [binary_dir] \n"
62       "                   [EXCLUDE_FROM_ALL])\n"
63       "Add a subdirectory to the build. The source_dir specifies the "
64       "directory in which the source CMakeLists.txt and code files are "
65       "located. If it is a relative "
66       "path it will be evaluated with respect to the current "
67       "directory (the typical usage), but it may also be an absolute path. "
68       "The binary_dir specifies the directory in which to place the output "
69       "files. If it is a relative path it will be evaluated with respect "
70       "to the current output directory, but it may also be an absolute "
71       "path. If binary_dir is not specified, the value of source_dir, "
72       "before expanding any relative path, will be used (the typical usage). "
73       "The CMakeLists.txt file in the specified source directory will "
74       "be processed immediately by CMake before processing in the current "
75       "input file continues beyond this command.\n"
76
77       "If the EXCLUDE_FROM_ALL argument is provided then targets in the "
78       "subdirectory will not be included in the ALL target of the parent "
79       "directory by default, and will be excluded from IDE project files.  "
80       "Users must explicitly build targets in the subdirectory.  "
81       "This is meant for use when the subdirectory contains a separate part "
82       "of the project that is useful but not necessary, such as a set of "
83       "examples.  "
84       "Typically the subdirectory should contain its own project() command "
85       "invocation so that a full build system will be generated in the "
86       "subdirectory (such as a VS IDE solution file).  "
87       "Note that inter-target dependencies supercede this exclusion.  "
88       "If a target built by the parent project depends on a target in the "
89       "subdirectory, the dependee target will be included in the parent "
90       "project build system to satisfy the dependency."
91       ;
92     }
93
94   cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
95 };
96
97
98
99 #endif