1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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
15 #include "cmExportFileGenerator.h"
17 class cmExportCommand;
19 /** \class cmExportBuildFileGenerator
20 * \brief Generate a file exporting targets from a build tree.
22 * cmExportBuildFileGenerator generates a file exporting targets from
23 * a build tree. A single file exports information for all
24 * configurations built.
26 * This is used to implement the EXPORT() command.
28 class cmExportBuildFileGenerator: public cmExportFileGenerator
31 cmExportBuildFileGenerator();
33 /** Set the list of targets to export. */
34 void SetExports(std::vector<cmTarget*> const* exports)
35 { this->Exports = exports; }
37 /** Set whether to append generated code to the output file. */
38 void SetAppendMode(bool append) { this->AppendMode = append; }
40 /** Set the command instance through which errors should be reported. */
41 void SetCommand(cmExportCommand* cmd) { this->ExportCommand = cmd; }
43 // Implement virtual methods from the superclass.
44 virtual bool GenerateMainFile(std::ostream& os);
45 virtual void GenerateImportTargetsConfig(std::ostream& os,
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,
55 void ComplainAboutMissingTarget(cmTarget* depender,
58 /** Fill in properties indicating built file locations. */
59 void SetImportLocationProperty(const char* config,
60 std::string const& suffix,
62 ImportPropertyMap& properties);
64 std::string InstallNameDir(cmTarget* target, const std::string& config);
66 std::vector<cmTarget*> const* Exports;
67 cmExportCommand* ExportCommand;