packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmAuxSourceDirectoryCommand.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 cmAuxSourceDirectoryCommand_h
13 #define cmAuxSourceDirectoryCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmAuxSourceDirectoryCommand
18  * \brief Specify auxiliary source code directories.
19  *
20  * cmAuxSourceDirectoryCommand specifies source code directories
21  * that must be built as part of this build process. This directories
22  * are not recursively processed like the SUBDIR command (cmSubdirCommand).
23  * A side effect of this command is to create a subdirectory in the build
24  * directory structure.
25  */
26 class cmAuxSourceDirectoryCommand : public cmCommand
27 {
28 public:
29   /**
30    * This is a virtual constructor for the command.
31    */
32   virtual cmCommand* Clone()
33     {
34     return new cmAuxSourceDirectoryCommand;
35     }
36
37   /**
38    * This is called when the command is first encountered in
39    * the CMakeLists.txt file.
40    */
41   virtual bool InitialPass(std::vector<std::string> const& args,
42                            cmExecutionStatus &status);
43
44   /**
45    * The name of the command as specified in CMakeList.txt.
46    */
47   virtual const char* GetName() const { return "aux_source_directory";}
48
49   /**
50    * Succinct documentation.
51    */
52   virtual const char* GetTerseDocumentation() const
53     {
54     return "Find all source files in a directory.";
55     }
56
57   /**
58    * More documentation.
59    */
60   virtual const char* GetFullDocumentation() const
61     {
62     return
63       "  aux_source_directory(<dir> <variable>)\n"
64       "Collects the names of all the source files in the specified "
65       "directory and stores the list in the <variable> provided.  This "
66       "command is intended to be used by projects that use explicit "
67       "template instantiation.  Template instantiation files can be "
68       "stored in a \"Templates\" subdirectory and collected automatically "
69       "using this command to avoid manually listing all instantiations.\n"
70       "It is tempting to use this command to avoid writing the list of "
71       "source files for a library or executable target.  While this seems "
72       "to work, there is no way for CMake to generate a build system that "
73       "knows when a new source file has been added.  Normally the "
74       "generated build system knows when it needs to rerun CMake because "
75       "the CMakeLists.txt file is modified to add a new source.  When the "
76       "source is just added to the directory without modifying this file, "
77       "one would have to manually rerun CMake to generate a build system "
78       "incorporating the new file.";
79     }
80
81   cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);
82 };
83
84
85
86 #endif