1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAddSubDirectoryCommand.h,v $
6 <<<<<<< cmAddSubDirectoryCommand.h
7 Date: $Date: 2008/01/23 15:27:59 $
8 Version: $Revision: 1.7 $
10 Date: $Date: 2008-08-07 21:12:16 $
11 Version: $Revision: 1.8 $
14 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
15 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
17 This software is distributed WITHOUT ANY WARRANTY; without even
18 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19 PURPOSE. See the above copyright notices for more information.
21 =========================================================================*/
22 #ifndef cmAddSubDirectoryCommand_h
23 #define cmAddSubDirectoryCommand_h
25 #include "cmCommand.h"
27 /** \class cmAddSubDirectoryCommand
28 * \brief Specify a subdirectory to build
30 * cmAddSubDirectoryCommand specifies a subdirectory to process
31 * by CMake. CMake will descend
32 * into the specified source directory and process any CMakeLists.txt found.
34 class cmAddSubDirectoryCommand
: public cmCommand
38 * This is a virtual constructor for the command.
40 virtual cmCommand
* Clone()
42 return new cmAddSubDirectoryCommand
;
46 * This is called when the command is first encountered in
47 * the CMakeLists.txt file.
49 virtual bool InitialPass(std::vector
<std::string
> const& args
,
50 cmExecutionStatus
&status
);
53 * The name of the command as specified in CMakeList.txt.
55 virtual const char* GetName() { return "add_subdirectory";}
58 * Succinct documentation.
60 virtual const char* GetTerseDocumentation()
62 return "Add a subdirectory to the build.";
68 virtual const char* GetFullDocumentation()
71 " add_subdirectory(source_dir [binary_dir] \n"
72 " [EXCLUDE_FROM_ALL])\n"
73 "Add a subdirectory to the build. The source_dir specifies the "
74 "directory in which the source CmakeLists.txt and code files are "
75 "located. If it is a relative "
76 "path it will be evaluated with respect to the current "
77 "directory (the typical usage), but it may also be an absolute path. "
78 "The binary_dir specifies the directory in which to place the output "
79 "files. If it is a relative path it will be evaluated with respect "
80 "to the current output directory, but it may also be an absolute "
81 "path. If binary_dir is not specified, the value of source_dir, "
82 "before expanding any relative path, will be used (the typical usage). "
83 "The CMakeLists.txt file in the specified source directory will "
84 "be processed immediately by CMake before processing in the current "
85 "input file continues beyond this command.\n"
87 "If the EXCLUDE_FROM_ALL argument is provided then targets in the "
88 "subdirectory will not be included in the ALL target of the parent "
89 "directory by default, and will be excluded from IDE project files. "
90 "Users must explicitly build targets in the subdirectory. "
91 "This is meant for use when the subdirectory contains a separate part "
92 "of the project that is useful but not necessary, such as a set of "
94 "Typically the subdirectory should contain its own project() command "
95 "invocation so that a full build system will be generated in the "
96 "subdirectory (such as a VS IDE solution file). "
97 "Note that inter-target dependencies supercede this exclusion. "
98 "If a target built by the parent project depends on a target in the "
99 "subdirectory, the dependee target will be included in the parent "
100 "project build system to satisfy the dependency."
104 cmTypeMacro(cmAddSubDirectoryCommand
, cmCommand
);