packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmExportTryCompileFileGenerator.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2013 Stephen Kelly <steveire@gmail.com>
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 cmExportInstallFileGenerator_h
13 #define cmExportInstallFileGenerator_h
14
15 #include "cmExportFileGenerator.h"
16
17 class cmInstallExportGenerator;
18 class cmInstallTargetGenerator;
19
20 class cmExportTryCompileFileGenerator: public cmExportFileGenerator
21 {
22 public:
23   /** Set the list of targets to export.  */
24   void SetExports(const std::vector<cmTarget*> &exports)
25     { this->Exports = exports; }
26   void SetConfig(const char *config) { this->Config = config; }
27 protected:
28
29   // Implement virtual methods from the superclass.
30   virtual bool GenerateMainFile(std::ostream& os);
31
32   virtual void GenerateImportTargetsConfig(std::ostream&,
33                                            const char*,
34                                            std::string const&,
35                             std::vector<std::string>&) {}
36   virtual void HandleMissingTarget(std::string&,
37                                    std::vector<std::string>&,
38                                    cmMakefile*,
39                                    cmTarget*,
40                                    cmTarget*) {}
41
42   void PopulateProperties(cmTarget* target,
43                           ImportPropertyMap& properties,
44                           std::set<cmTarget*> &emitted);
45
46   std::string InstallNameDir(cmTarget* target,
47                              const std::string& config);
48 private:
49   std::string FindTargets(const char *prop, cmTarget *tgt,
50                    std::set<cmTarget*> &emitted);
51
52
53   std::vector<cmTarget*> Exports;
54   const char *Config;
55 };
56
57 #endif