1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAddSubDirectoryCommand.h,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.7 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmAddSubDirectoryCommand_h
18 #define cmAddSubDirectoryCommand_h
20 #include "cmCommand.h"
22 /** \class cmAddSubDirectoryCommand
23 * \brief Specify a subdirectory to build
25 * cmAddSubDirectoryCommand specifies a subdirectory to process
26 * by CMake. CMake will descend
27 * into the specified source directory and process any CMakeLists.txt found.
29 class cmAddSubDirectoryCommand
: public cmCommand
33 * This is a virtual constructor for the command.
35 virtual cmCommand
* Clone()
37 return new cmAddSubDirectoryCommand
;
41 * This is called when the command is first encountered in
42 * the CMakeLists.txt file.
44 virtual bool InitialPass(std::vector
<std::string
> const& args
,
45 cmExecutionStatus
&status
);
48 * The name of the command as specified in CMakeList.txt.
50 virtual const char* GetName() { return "add_subdirectory";}
53 * Succinct documentation.
55 virtual const char* GetTerseDocumentation()
57 return "Add a subdirectory to the build.";
63 virtual const char* GetFullDocumentation()
66 " add_subdirectory(source_dir [binary_dir] \n"
67 " [EXCLUDE_FROM_ALL])\n"
68 "Add a subdirectory to the build. The source_dir specifies the "
69 "directory in which the source CmakeLists.txt and code files are "
70 "located. If it is a relative "
71 "path it will be evaluated with respect to the current "
72 "directory (the typical usage), but it may also be an absolute path. "
73 "The binary_dir specifies the directory in which to place the output "
74 "files. If it is a relative path it will be evaluated with respect "
75 "to the current output directory, but it may also be an absolute "
76 "path. If binary_dir is not specified, the value of source_dir, "
77 "before expanding any relative path, will be used (the typical usage). "
78 "The CMakeLists.txt file in the specified source directory will "
79 "be processed immediately by CMake before processing in the current "
80 "input file continues beyond this command.\n"
82 "If the EXCLUDE_FROM_ALL argument is provided then this subdirectory "
83 "will not be included in build by default. Users will have to "
84 "explicitly start a build in the generated output directory. "
85 "This is useful for having cmake create a build system for a "
86 "set of examples in a project. One would want cmake to generate "
87 "a single build system for all the examples, but one may not want "
88 "the targets to show up in the main build system.";
91 cmTypeMacro(cmAddSubDirectoryCommand
, cmCommand
);