cmInstallTargetGenerator.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 cmInstallTargetGenerator_h
  14. #define cmInstallTargetGenerator_h
  15. #include "cmInstallGenerator.h"
  16. #include "cmTarget.h"
  17. /** \class cmInstallTargetGenerator
  18. * \brief Generate target installation rules.
  19. */
  20. class cmInstallTargetGenerator: public cmInstallGenerator
  21. {
  22. public:
  23. cmInstallTargetGenerator(
  24. cmTarget& t, const char* dest, bool implib,
  25. const char* file_permissions = "",
  26. std::vector<std::string> const& configurations
  27. = std::vector<std::string>(),
  28. const char* component = "",
  29. bool optional = false
  30. );
  31. virtual ~cmInstallTargetGenerator();
  32. std::string GetInstallFilename(const char* config) const;
  33. static std::string GetInstallFilename(cmTarget*target, const char* config,
  34. bool implib, bool useSOName);
  35. protected:
  36. typedef cmInstallGeneratorIndent Indent;
  37. virtual void GenerateScript(std::ostream& os);
  38. void GenerateScriptForConfig(std::ostream& os,
  39. const char* fromDir,
  40. const char* config,
  41. Indent const& indent);
  42. void GenerateScriptForConfigDir(std::ostream& os,
  43. const char* fromDirConfig,
  44. const char* config,
  45. Indent const& indent);
  46. void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
  47. const char* config,
  48. const std::string& toDestDirPath);
  49. void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
  50. std::string const& toDestDirPath);
  51. void AddStripRule(std::ostream& os, Indent const& indent,
  52. cmTarget::TargetType type,
  53. const std::string& toDestDirPath);
  54. void AddRanlibRule(std::ostream& os, Indent const& indent,
  55. cmTarget::TargetType type,
  56. const std::string& toDestDirPath);
  57. cmTarget* Target;
  58. bool ImportLibrary;
  59. std::string FilePermissions;
  60. bool Optional;
  61. };
  62. #endif