Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmSubdirCommand.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 cmSubdirCommand_h
13 #define cmSubdirCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmSubdirCommand
18  * \brief Specify a list of subdirectories to build.
19  *
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.
23  */
24 class cmSubdirCommand : public cmCommand
25 {
26 public:
27   /**
28    * This is a virtual constructor for the command.
29    */
30   virtual cmCommand* Clone()
31     {
32     return new cmSubdirCommand;
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 "subdirs";}
46
47   /**
48    * Succinct documentation.
49    */
50   virtual const char* GetTerseDocumentation() const
51     {
52     return "Deprecated. Use the add_subdirectory() command instead.";
53     }
54
55   /**
56    * More documentation.
57    */
58   virtual const char* GetFullDocumentation() const
59     {
60     return
61       "Add a list of subdirectories to the build.\n"
62       "  subdirs(dir1 dir2 ..."
63       "[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]\n"
64       "          [PREORDER] )\n"
65       "Add a list of subdirectories to the build. The add_subdirectory "
66       "command should be used instead of subdirs although subdirs will "
67       "still work. "
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.";
79     }
80
81   /** This command is kept for compatibility with older CMake versions. */
82   virtual bool IsDiscouraged() const
83     {
84     return true;
85     }
86
87   cmTypeMacro(cmSubdirCommand, cmCommand);
88 };
89
90
91
92 #endif