1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmExportBuildFileGenerator.h,v $
6 Date: $Date: 2008/02/01 13:56:00 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmExportBuildFileGenerator_h
18 #define cmExportBuildFileGenerator_h
20 #include "cmExportFileGenerator.h"
22 class cmExportCommand
;
24 /** \class cmExportBuildFileGenerator
25 * \brief Generate a file exporting targets from a build tree.
27 * cmExportBuildFileGenerator generates a file exporting targets from
28 * a build tree. A single file exports information for all
29 * configurations built.
31 * This is used to implement the EXPORT() command.
33 class cmExportBuildFileGenerator
: public cmExportFileGenerator
36 cmExportBuildFileGenerator();
38 /** Set the list of targets to export. */
39 void SetExports(std::vector
<cmTarget
*> const* exports
)
40 { this->Exports
= exports
; }
42 /** Set whether to append generated code to the output file. */
43 void SetAppendMode(bool append
) { this->AppendMode
= append
; }
45 /** Set the command instance through which errors should be reported. */
46 void SetCommand(cmExportCommand
* cmd
) { this->ExportCommand
= cmd
; }
48 // Implement virtual methods from the superclass.
49 virtual bool GenerateMainFile(std::ostream
& os
);
50 virtual void GenerateImportTargetsConfig(std::ostream
& os
,
52 std::string
const& suffix
);
53 virtual void ComplainAboutMissingTarget(cmTarget
* depender
,
56 /** Fill in properties indicating built file locations. */
57 void SetImportLocationProperty(const char* config
,
58 std::string
const& suffix
,
60 ImportPropertyMap
& properties
);
62 std::vector
<cmTarget
*> const* Exports
;
63 cmExportCommand
* ExportCommand
;