packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmExportBuildFileGenerator.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 cmExportBuildFileGenerator_h
13 #define cmExportBuildFileGenerator_h
14
15 #include "cmExportFileGenerator.h"
16
17 class cmExportCommand;
18
19 /** \class cmExportBuildFileGenerator
20  * \brief Generate a file exporting targets from a build tree.
21  *
22  * cmExportBuildFileGenerator generates a file exporting targets from
23  * a build tree.  A single file exports information for all
24  * configurations built.
25  *
26  * This is used to implement the EXPORT() command.
27  */
28 class cmExportBuildFileGenerator: public cmExportFileGenerator
29 {
30 public:
31   cmExportBuildFileGenerator();
32
33   /** Set the list of targets to export.  */
34   void SetExports(std::vector<cmTarget*> const* exports)
35     { this->Exports = exports; }
36
37   /** Set whether to append generated code to the output file.  */
38   void SetAppendMode(bool append) { this->AppendMode = append; }
39
40   /** Set the command instance through which errors should be reported.  */
41   void SetCommand(cmExportCommand* cmd) { this->ExportCommand = cmd; }
42 protected:
43   // Implement virtual methods from the superclass.
44   virtual bool GenerateMainFile(std::ostream& os);
45   virtual void GenerateImportTargetsConfig(std::ostream& os,
46                                            const char* config,
47                                            std::string const& suffix,
48                             std::vector<std::string> &missingTargets);
49   virtual void HandleMissingTarget(std::string& link_libs,
50                                    std::vector<std::string>& missingTargets,
51                                    cmMakefile* mf,
52                                    cmTarget* depender,
53                                    cmTarget* dependee);
54
55   void ComplainAboutMissingTarget(cmTarget* depender,
56                                   cmTarget* dependee);
57
58   /** Fill in properties indicating built file locations.  */
59   void SetImportLocationProperty(const char* config,
60                                  std::string const& suffix,
61                                  cmTarget* target,
62                                  ImportPropertyMap& properties);
63
64   std::string InstallNameDir(cmTarget* target, const std::string& config);
65
66   std::vector<cmTarget*> const* Exports;
67   cmExportCommand* ExportCommand;
68 };
69
70 #endif