cmInstallExportGenerator.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. /* cmInstallExportTarget is used in cmGlobalGenerator to collect the
  19. install generators for the exported targets. These are then used by the
  20. cmInstallExportGenerator.
  21. */
  22. class cmTargetExport
  23. {
  24. public:
  25. cmTargetExport(cmTarget* tgt,
  26. cmInstallTargetGenerator* archive,
  27. cmInstallTargetGenerator* runtime,
  28. cmInstallTargetGenerator* library
  29. ) : Target(tgt), ArchiveGenerator(archive),
  30. RuntimeGenerator(runtime), LibraryGenerator(library) {}
  31. cmTarget* Target;
  32. cmInstallTargetGenerator* ArchiveGenerator;
  33. cmInstallTargetGenerator* RuntimeGenerator;
  34. cmInstallTargetGenerator* LibraryGenerator;
  35. private:
  36. cmTargetExport();
  37. };
  38. /** \class cmInstallExportGenerator
  39. * \brief Generate rules for creating an export files.
  40. */
  41. class cmInstallExportGenerator: public cmInstallGenerator
  42. {
  43. public:
  44. cmInstallExportGenerator(const char* dest, const char* file_permissions,
  45. const std::vector<std::string>& configurations,
  46. const char* component,
  47. const char* filename, const char* prefix,
  48. const char* tempOutputDir);
  49. bool SetExportSet(const char* name,
  50. const std::vector<cmTargetExport*>* exportSet);
  51. protected:
  52. // internal class which collects all the properties which will be set
  53. // in the export file for the target
  54. class cmTargetWithProperties
  55. {
  56. public:
  57. cmTargetWithProperties(cmTarget* target):Target(target) {}
  58. cmTarget* Target;
  59. std::map<std::string, std::string> Properties;
  60. private:
  61. cmTargetWithProperties();
  62. };
  63. typedef cmInstallGeneratorIndent Indent;
  64. virtual void GenerateScript(std::ostream& os);
  65. virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
  66. static bool AddInstallLocations(cmTargetWithProperties *twp,
  67. cmInstallTargetGenerator* generator,
  68. const char* prefix);
  69. std::string Name;
  70. std::string FilePermissions;
  71. std::string Filename;
  72. std::string Prefix;
  73. std::string TempOutputDir;
  74. std::string ExportFilename;
  75. std::vector<cmTargetWithProperties*> Targets;
  76. };
  77. #endif