Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmInstallTargetGenerator.h
blob7810d18245c89f3e0654fb2e583ea92f670ddced
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallTargetGenerator.h,v $
5 Language: C++
6 Date: $Date: 2009-03-16 14:39:50 $
7 Version: $Revision: 1.29 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmInstallTargetGenerator_h
18 #define cmInstallTargetGenerator_h
20 #include "cmInstallGenerator.h"
21 #include "cmTarget.h"
23 /** \class cmInstallTargetGenerator
24 * \brief Generate target installation rules.
26 class cmInstallTargetGenerator: public cmInstallGenerator
28 public:
29 cmInstallTargetGenerator(
30 cmTarget& t, const char* dest, bool implib,
31 const char* file_permissions = "",
32 std::vector<std::string> const& configurations
33 = std::vector<std::string>(),
34 const char* component = "Unspecified",
35 bool optional = false
37 virtual ~cmInstallTargetGenerator();
39 /** Select the policy for installing shared library linkable name
40 symlinks. */
41 enum NamelinkModeType
43 NamelinkModeNone,
44 NamelinkModeOnly,
45 NamelinkModeSkip
47 void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; }
48 NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; }
50 std::string GetInstallFilename(const char* config) const;
52 enum NameType
54 NameNormal,
55 NameImplib,
56 NameSO,
57 NameReal
60 static std::string GetInstallFilename(cmTarget*target, const char* config,
61 NameType nameType = NameNormal);
63 cmTarget* GetTarget() const { return this->Target; }
64 bool IsImportLibrary() const { return this->ImportLibrary; }
66 protected:
67 virtual void GenerateScript(std::ostream& os);
68 virtual void GenerateScriptForConfig(std::ostream& os,
69 const char* config,
70 Indent const& indent);
71 void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
72 const char* config,
73 const std::string& toDestDirPath);
74 void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
75 const char* config,
76 std::string const& toDestDirPath);
77 void AddRPathCheckRule(std::ostream& os, Indent const& indent,
78 const char* config,
79 std::string const& toDestDirPath);
81 void AddStripRule(std::ostream& os, Indent const& indent,
82 cmTarget::TargetType type,
83 const std::string& toDestDirPath);
84 void AddRanlibRule(std::ostream& os, Indent const& indent,
85 cmTarget::TargetType type,
86 const std::string& toDestDirPath);
88 cmTarget* Target;
89 bool ImportLibrary;
90 std::string FilePermissions;
91 bool Optional;
92 NamelinkModeType NamelinkMode;
93 std::string FromDir;
96 #endif