Rescan dependencies also if CMakeDirectoryInformation.cmake has changed.
[cmake.git] / Source / cmExportInstallFileGenerator.h
blob0e3bba71b0baa3d3a3ffec80b5e714bb5ef3e015
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmExportInstallFileGenerator.h,v $
5 Language: C++
6 Date: $Date: 2009-01-07 19:16:28 $
7 Version: $Revision: 1.3 $
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 cmExportInstallFileGenerator_h
18 #define cmExportInstallFileGenerator_h
20 #include "cmExportFileGenerator.h"
22 class cmInstallExportGenerator;
23 class cmInstallFilesGenerator;
24 class cmInstallTargetGenerator;
25 class cmTargetExport;
27 /** \class cmExportInstallFileGenerator
28 * \brief Generate a file exporting targets from an install tree.
30 * cmExportInstallFileGenerator generates files exporting targets from
31 * install an installation tree. The files are placed in a temporary
32 * location for installation by cmInstallExportGenerator. One main
33 * file is generated that creates the imported targets and loads
34 * per-configuration files. Target locations and settings for each
35 * configuration are written to these per-configuration files. After
36 * installation the main file loads the configurations that have been
37 * installed.
39 * This is used to implement the INSTALL(EXPORT) command.
41 class cmExportInstallFileGenerator: public cmExportFileGenerator
43 public:
44 /** Construct with the export installer that will install the
45 files. */
46 cmExportInstallFileGenerator(cmInstallExportGenerator* iegen);
48 /** Set the name of the export associated with the files. This is
49 the name given to the install(EXPORT) command mode. */
50 void SetName(const char* name) { this->Name = name; }
52 /** Set the set of targets to be exported. These are the targets
53 associated with the export name. */
54 void SetExportSet(std::vector<cmTargetExport*> const* eSet)
55 { this->ExportSet = eSet; }
57 /** Get the per-config file generated for each configuraiton. This
58 maps from the configuration name to the file temporary location
59 for installation. */
60 std::map<cmStdString, cmStdString> const& GetConfigImportFiles()
61 { return this->ConfigImportFiles; }
63 /** Compute the globbing expression used to load per-config import
64 files from the main file. */
65 std::string GetConfigImportFileGlob();
66 protected:
68 // Implement virtual methods from the superclass.
69 virtual bool GenerateMainFile(std::ostream& os);
70 virtual void GenerateImportTargetsConfig(std::ostream& os,
71 const char* config,
72 std::string const& suffix);
73 virtual void ComplainAboutMissingTarget(cmTarget* depender,
74 cmTarget* dependee);
76 /** Generate a per-configuration file for the targets. */
77 bool GenerateImportFileConfig(const char* config);
79 /** Fill in properties indicating installed file locations. */
80 void SetImportLocationProperty(const char* config,
81 std::string const& suffix,
82 cmInstallTargetGenerator* itgen,
83 ImportPropertyMap& properties);
85 void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen);
87 cmInstallExportGenerator* InstallExportGenerator;
88 std::string Name;
89 std::vector<cmTargetExport*> const* ExportSet;
91 std::string ImportPrefix;
93 // The import file generated for each configuration.
94 std::map<cmStdString, cmStdString> ConfigImportFiles;
98 cmTargetExport is used in cmGlobalGenerator to collect the install
99 generators for targets associated with an export.
101 class cmTargetExport
103 public:
104 cmTargetExport(cmTarget* tgt,
105 cmInstallTargetGenerator* archive,
106 cmInstallTargetGenerator* runtime,
107 cmInstallTargetGenerator* library,
108 cmInstallTargetGenerator* framework,
109 cmInstallTargetGenerator* bundle,
110 cmInstallFilesGenerator* headers
111 ) : Target(tgt), ArchiveGenerator(archive),
112 RuntimeGenerator(runtime), LibraryGenerator(library),
113 FrameworkGenerator(framework), BundleGenerator(bundle),
114 HeaderGenerator(headers) {}
116 cmTarget* Target;
117 cmInstallTargetGenerator* ArchiveGenerator;
118 cmInstallTargetGenerator* RuntimeGenerator;
119 cmInstallTargetGenerator* LibraryGenerator;
120 cmInstallTargetGenerator* FrameworkGenerator;
121 cmInstallTargetGenerator* BundleGenerator;
122 cmInstallFilesGenerator* HeaderGenerator;
123 private:
124 cmTargetExport();
127 #endif