Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmExportLibraryDependencies.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 cmExportLibraryDependenciesCommand_h
13 #define cmExportLibraryDependenciesCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmExportLibraryDependenciesCommand
18  * \brief Add a test to the lists of tests to run.
19  *
20  * cmExportLibraryDependenciesCommand adds a test to the list of tests to run
21  *
22  */
23 class cmExportLibraryDependenciesCommand : public cmCommand
24 {
25 public:
26   /**
27    * This is a virtual constructor for the command.
28    */
29   virtual cmCommand* Clone()
30     {
31     return new cmExportLibraryDependenciesCommand;
32     }
33
34   /**
35    * This is called when the command is first encountered in
36    * the CMakeLists.txt file.
37    */
38   virtual bool InitialPass(std::vector<std::string> const& args,
39                            cmExecutionStatus &status);
40
41   /**
42    * This is called at the end after all the information
43    * specified by the command is accumulated.
44    */
45   virtual void FinalPass();
46   virtual bool HasFinalPass() const { return true; }
47
48   /**
49    * The name of the command as specified in CMakeList.txt.
50    */
51   virtual const char* GetName() const { return "export_library_dependencies";}
52
53   /**
54    * Succinct documentation.
55    */
56   virtual const char* GetTerseDocumentation() const
57     {
58     return "Deprecated.  Use INSTALL(EXPORT) or EXPORT command.";
59     }
60
61   /**
62    * More documentation.
63    */
64   virtual const char* GetFullDocumentation() const
65     {
66     return
67       "This command generates an old-style library dependencies file.  "
68       "Projects requiring CMake 2.6 or later should not use the command.  "
69       "Use instead the install(EXPORT) command to help export targets "
70       "from an installation tree and the export() command to export targets "
71       "from a build tree.\n"
72       "The old-style library dependencies file does not take into account "
73       "per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES "
74       "target property.\n"
75       "  export_library_dependencies(<file> [APPEND])\n"
76       "Create a file named <file> that can be included into a CMake listfile "
77       "with the INCLUDE command.  The file will contain a number of SET "
78       "commands that will set all the variables needed for library dependency "
79       "information.  This should be the last command in the top level "
80       "CMakeLists.txt file of the project.  If the APPEND option is "
81       "specified, the SET commands will be appended to the given file "
82       "instead of replacing it.";
83     }
84
85   /** This command is kept for compatibility with older CMake versions. */
86   virtual bool IsDiscouraged() const
87     {
88     return true;
89     }
90
91   cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand);
92
93 private:
94   std::string Filename;
95   bool Append;
96   void ConstFinalPass() const;
97 };
98
99
100 #endif