ENH: fix uppercase version so defines are not upper as well
[cmake.git] / Source / cmInstallTargetGenerator.h
blobe81cb0e95a733a3a1ba0580c0cd70a8ca7d89e5f
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallTargetGenerator.h,v $
5 Language: C++
6 Date: $Date: 2008-10-03 14:11:47 $
7 Version: $Revision: 1.27 $
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 typedef cmInstallGeneratorIndent Indent;
68 virtual void GenerateScript(std::ostream& os);
69 virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
70 virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
71 void GenerateScriptForConfig(std::ostream& os,
72 const char* config,
73 Indent const& indent);
74 void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
75 const char* config,
76 const std::string& toDestDirPath);
77 void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
78 const char* config,
79 std::string const& toDestDirPath);
80 void AddRPathCheckRule(std::ostream& os, Indent const& indent,
81 const char* config,
82 std::string const& toDestDirPath);
84 void AddStripRule(std::ostream& os, Indent const& indent,
85 cmTarget::TargetType type,
86 const std::string& toDestDirPath);
87 void AddRanlibRule(std::ostream& os, Indent const& indent,
88 cmTarget::TargetType type,
89 const std::string& toDestDirPath);
91 cmTarget* Target;
92 bool ImportLibrary;
93 std::string FilePermissions;
94 bool Optional;
95 NamelinkModeType NamelinkMode;
96 std::string FromDir;
99 #endif