1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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 cmSubdirCommand_h
13 #define cmSubdirCommand_h
15 #include "cmCommand.h"
17 /** \class cmSubdirCommand
18 * \brief Specify a list of subdirectories to build.
20 * cmSubdirCommand specifies a list of subdirectories to process
21 * by CMake. For each subdirectory listed, CMake will descend
22 * into that subdirectory and process any CMakeLists.txt found.
24 class cmSubdirCommand : public cmCommand
28 * This is a virtual constructor for the command.
30 virtual cmCommand* Clone()
32 return new cmSubdirCommand;
36 * This is called when the command is first encountered in
37 * the CMakeLists.txt file.
39 virtual bool InitialPass(std::vector<std::string> const& args,
40 cmExecutionStatus &status);
43 * The name of the command as specified in CMakeList.txt.
45 virtual const char* GetName() const { return "subdirs";}
48 * Succinct documentation.
50 virtual const char* GetTerseDocumentation() const
52 return "Deprecated. Use the add_subdirectory() command instead.";
58 virtual const char* GetFullDocumentation() const
61 "Add a list of subdirectories to the build.\n"
62 " subdirs(dir1 dir2 ..."
63 "[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]\n"
65 "Add a list of subdirectories to the build. The add_subdirectory "
66 "command should be used instead of subdirs although subdirs will "
68 "This will cause any CMakeLists.txt files in the sub directories "
69 "to be processed by CMake. Any directories after the PREORDER flag "
70 "are traversed first by makefile builds, the PREORDER flag has no "
71 "effect on IDE projects. "
72 " Any directories after the EXCLUDE_FROM_ALL marker "
73 "will not be included in the top level makefile or project file. "
74 "This is useful for having CMake create makefiles or projects for "
75 "a set of examples in a project. You would want CMake to "
76 "generate makefiles or project files for all the examples at "
77 "the same time, but you would not want them to show up in the "
78 "top level project or be built each time make is run from the top.";
81 /** This command is kept for compatibility with older CMake versions. */
82 virtual bool IsDiscouraged() const
87 cmTypeMacro(cmSubdirCommand, cmCommand);