1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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 cmInstallTargetGenerator_h
13 #define cmInstallTargetGenerator_h
15 #include "cmInstallGenerator.h"
17 #include "cmGeneratorTarget.h"
19 /** \class cmInstallTargetGenerator
20 * \brief Generate target installation rules.
22 class cmInstallTargetGenerator: public cmInstallGenerator
25 cmInstallTargetGenerator(
26 cmTarget& t, const char* dest, bool implib,
27 const char* file_permissions = "",
28 std::vector<std::string> const& configurations
29 = std::vector<std::string>(),
30 const char* component = "Unspecified",
33 virtual ~cmInstallTargetGenerator();
35 /** Select the policy for installing shared library linkable name
43 void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; }
44 NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; }
46 std::string GetInstallFilename(const char* config) const;
56 static std::string GetInstallFilename(cmTarget*target, const char* config,
57 NameType nameType = NameNormal);
59 cmTarget* GetTarget() const { return this->Target; }
60 bool IsImportLibrary() const { return this->ImportLibrary; }
63 virtual void GenerateScript(std::ostream& os);
64 virtual void GenerateScriptForConfig(std::ostream& os,
66 Indent const& indent);
67 typedef void (cmInstallTargetGenerator::*TweakMethod)(
68 std::ostream&, Indent const&, const char*, std::string const&
70 void AddTweak(std::ostream& os, Indent const& indent,
71 const char* config, std::string const& file,
73 void AddTweak(std::ostream& os, Indent const& indent,
74 const char* config, std::vector<std::string> const& files,
76 std::string GetDestDirPath(std::string const& file);
77 void PreReplacementTweaks(std::ostream& os, Indent const& indent,
78 const char* config, std::string const& file);
79 void PostReplacementTweaks(std::ostream& os, Indent const& indent,
80 const char* config, std::string const& file);
81 void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
83 const std::string& toDestDirPath);
84 void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
86 std::string const& toDestDirPath);
87 void AddRPathCheckRule(std::ostream& os, Indent const& indent,
89 std::string const& toDestDirPath);
91 void AddStripRule(std::ostream& os, Indent const& indent,
92 const std::string& toDestDirPath);
93 void AddRanlibRule(std::ostream& os, Indent const& indent,
94 const std::string& toDestDirPath);
98 std::string FilePermissions;
100 NamelinkModeType NamelinkMode;
101 cmGeneratorTarget* GeneratorTarget;