cmInstallExportGenerator.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmInstallExportGenerator_h
  14. #define cmInstallExportGenerator_h
  15. #include "cmInstallGenerator.h"
  16. class cmTarget;
  17. class cmInstallTargetGenerator;
  18. class cmInstallFilesGenerator;
  19. /* cmInstallExportTarget is used in cmGlobalGenerator to collect the
  20. install generators for the exported targets. These are then used by the
  21. cmInstallExportGenerator.
  22. */
  23. class cmTargetExport
  24. {
  25. public:
  26. cmTargetExport(cmTarget* tgt,
  27. cmInstallTargetGenerator* archive,
  28. cmInstallTargetGenerator* runtime,
  29. cmInstallTargetGenerator* library,
  30. cmInstallTargetGenerator* framework,
  31. cmInstallTargetGenerator* bundle,
  32. cmInstallFilesGenerator* headers
  33. ) : Target(tgt), ArchiveGenerator(archive),
  34. RuntimeGenerator(runtime), LibraryGenerator(library),
  35. FrameworkGenerator(framework), BundleGenerator(bundle),
  36. HeaderGenerator(headers) {}
  37. cmTarget* Target;
  38. cmInstallTargetGenerator* ArchiveGenerator;
  39. cmInstallTargetGenerator* RuntimeGenerator;
  40. cmInstallTargetGenerator* LibraryGenerator;
  41. cmInstallTargetGenerator* FrameworkGenerator;
  42. cmInstallTargetGenerator* BundleGenerator;
  43. cmInstallFilesGenerator* HeaderGenerator;
  44. private:
  45. cmTargetExport();
  46. };
  47. /** \class cmInstallExportGenerator
  48. * \brief Generate rules for creating an export files.
  49. */
  50. class cmInstallExportGenerator: public cmInstallGenerator
  51. {
  52. public:
  53. cmInstallExportGenerator(const char* dest, const char* file_permissions,
  54. const std::vector<std::string>& configurations,
  55. const char* component,
  56. const char* filename, const char* prefix,
  57. const char* tempOutputDir);
  58. bool SetExportSet(const char* name,
  59. const std::vector<cmTargetExport*>* exportSet);
  60. protected:
  61. // internal class which collects all the properties which will be set
  62. // in the export file for the target
  63. class cmTargetWithProperties
  64. {
  65. public:
  66. cmTargetWithProperties(cmTarget* target):Target(target) {}
  67. cmTarget* Target;
  68. std::map<std::string, std::string> Properties;
  69. private:
  70. cmTargetWithProperties();
  71. };
  72. typedef cmInstallGeneratorIndent Indent;
  73. virtual void GenerateScript(std::ostream& os);
  74. virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
  75. static bool AddInstallLocations(cmTargetWithProperties *twp,
  76. cmInstallTargetGenerator* generator,
  77. const char* prefix);
  78. static bool AddInstallLocations(cmTargetWithProperties* twp,
  79. cmInstallFilesGenerator* generator,
  80. const char* propertyName);
  81. std::string Name;
  82. std::string FilePermissions;
  83. std::string Filename;
  84. std::string Prefix;
  85. std::string TempOutputDir;
  86. std::string ExportFilename;
  87. std::vector<cmTargetWithProperties*> Targets;
  88. };
  89. #endif