cmake/Source/cmInstallTargetGenerator.h

116 lines
4.2 KiB
C
Raw Normal View History

2009-10-04 10:30:41 +03:00
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
2009-10-04 10:30:41 +03:00
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
2009-10-04 10:30:41 +03:00
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmInstallTargetGenerator_h
#define cmInstallTargetGenerator_h
#include "cmInstallGenerator.h"
2015-11-17 17:22:37 +01:00
class cmGeneratorTarget;
/** \class cmInstallTargetGenerator
* \brief Generate target installation rules.
*/
class cmInstallTargetGenerator: public cmInstallGenerator
{
public:
cmInstallTargetGenerator(
2015-11-17 17:22:37 +01:00
std::string const& targetName, const char* dest, bool implib,
2015-04-27 22:25:09 +02:00
const char* file_permissions,
std::vector<std::string> const& configurations,
const char* component,
MessageLevel message,
bool optional
);
virtual ~cmInstallTargetGenerator();
/** Select the policy for installing shared library linkable name
symlinks. */
enum NamelinkModeType
{
NamelinkModeNone,
NamelinkModeOnly,
NamelinkModeSkip
};
void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; }
NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; }
2015-04-27 22:25:09 +02:00
std::string GetInstallFilename(const std::string& config) const;
enum NameType
{
NameNormal,
NameImplib,
NameSO,
NameReal
};
2016-03-13 13:35:51 +01:00
static std::string GetInstallFilename(const cmGeneratorTarget* target,
2015-04-27 22:25:09 +02:00
const std::string& config,
NameType nameType = NameNormal);
2015-11-17 17:22:37 +01:00
void Compute(cmLocalGenerator* lg);
cmGeneratorTarget* GetTarget() const { return this->Target; }
bool IsImportLibrary() const { return this->ImportLibrary; }
2015-08-17 11:37:30 +02:00
std::string GetDestination(std::string const& config) const;
protected:
virtual void GenerateScript(std::ostream& os);
2009-10-04 10:30:41 +03:00
virtual void GenerateScriptForConfig(std::ostream& os,
2015-04-27 22:25:09 +02:00
const std::string& config,
2009-10-04 10:30:41 +03:00
Indent const& indent);
2010-03-17 14:00:29 +02:00
typedef void (cmInstallTargetGenerator::*TweakMethod)(
2015-04-27 22:25:09 +02:00
std::ostream&, Indent const&, const std::string&, std::string const&
2010-03-17 14:00:29 +02:00
);
void AddTweak(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config, std::string const& file,
2010-03-17 14:00:29 +02:00
TweakMethod tweak);
void AddTweak(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::vector<std::string> const& files,
2010-03-17 14:00:29 +02:00
TweakMethod tweak);
std::string GetDestDirPath(std::string const& file);
void PreReplacementTweaks(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& file);
2010-03-17 14:00:29 +02:00
void PostReplacementTweaks(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& file);
void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
const std::string& toDestDirPath);
void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& toDestDirPath);
void AddRPathCheckRule(std::ostream& os, Indent const& indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& toDestDirPath);
2013-03-16 19:13:01 +02:00
void AddStripRule(std::ostream& os, Indent const& indent,
const std::string& toDestDirPath);
void AddRanlibRule(std::ostream& os, Indent const& indent,
const std::string& toDestDirPath);
2016-03-13 13:35:51 +01:00
void AddUniversalInstallRule(std::ostream& os, Indent const& indent,
const std::string& toDestDirPath);
2015-11-17 17:22:37 +01:00
std::string TargetName;
cmGeneratorTarget* Target;
std::string FilePermissions;
NamelinkModeType NamelinkMode;
2015-11-17 17:22:37 +01:00
bool ImportLibrary;
bool Optional;
};
#endif