Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmOutputRequiredFilesCommand.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 cmOutputRequiredFilesCommand_h
13 #define cmOutputRequiredFilesCommand_h
14
15 #include "cmCommand.h"
16 #include "cmMakeDepend.h"
17
18 /** \class cmOutputRequiredFilesCommand
19  * \brief Output a list of required files for a source file
20  *
21  */
22 class cmOutputRequiredFilesCommand : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone() 
29     {
30     return new cmOutputRequiredFilesCommand;
31     }
32
33   /**
34    * This is called when the command is first encountered in
35    * the CMakeLists.txt file.
36    */
37   virtual bool InitialPass(std::vector<std::string> const& args,
38                            cmExecutionStatus &status);
39
40   /**
41    * The name of the command as specified in CMakeList.txt.
42    */
43   virtual const char* GetName() const { return "output_required_files";}
44
45   /**
46    * Succinct documentation.
47    */
48   virtual const char* GetTerseDocumentation() const
49     {
50     return "Deprecated.  Approximate C preprocessor dependency scanning.";
51     }
52   
53   /**
54    * More documentation.
55    */
56   virtual const char* GetFullDocumentation() const
57     {
58     return
59       "This command exists only because ancient CMake versions provided it.  "
60       "CMake handles preprocessor dependency scanning automatically using a "
61       "more advanced scanner.\n"
62       "  output_required_files(srcfile outputfile)\n"
63       "Outputs a list of all the source files that are required by the "
64       "specified srcfile. This list is written into outputfile. This is "
65       "similar to writing out the dependencies for srcfile except that it "
66       "jumps from .h files into .cxx, .c and .cpp files if possible.";
67     }
68
69   /** This command is kept for compatibility with older CMake versions. */
70   virtual bool IsDiscouraged() const
71     {
72     return true;
73     }
74
75   
76   cmTypeMacro(cmOutputRequiredFilesCommand, cmCommand);
77   void ListDependencies(cmDependInformation const *info,
78                         FILE *fout,
79                         std::set<cmDependInformation const*> *visited);
80
81 private:
82   std::string File;
83   std::string OutputFile;
84 };
85
86
87
88 #endif