cmake/Source/cmInstallTargetGenerator.h

114 lines
4.3 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmInstallTargetGenerator_h
#define cmInstallTargetGenerator_h
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h"
2016-10-30 18:24:19 +01:00
#include "cmInstallGenerator.h"
2016-10-30 18:24:19 +01:00
#include "cmScriptGenerator.h"
#include <iosfwd>
#include <string>
#include <vector>
2015-11-17 17:22:37 +01:00
class cmGeneratorTarget;
2016-10-30 18:24:19 +01:00
class cmLocalGenerator;
/** \class cmInstallTargetGenerator
* \brief Generate target installation rules.
*/
2016-07-09 11:21:54 +02:00
class cmInstallTargetGenerator : public cmInstallGenerator
{
public:
2016-07-09 11:21:54 +02:00
cmInstallTargetGenerator(std::string const& targetName, const char* dest,
bool implib, const char* file_permissions,
std::vector<std::string> const& configurations,
const char* component, MessageLevel message,
bool exclude_from_all, bool optional);
2016-10-30 18:24:19 +01:00
~cmInstallTargetGenerator() CM_OVERRIDE;
/** 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;
2017-07-20 19:35:53 +02:00
void GetInstallObjectNames(std::string const& config,
std::vector<std::string>& objects) 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);
2016-10-30 18:24:19 +01:00
void Compute(cmLocalGenerator* lg) CM_OVERRIDE;
2015-11-17 17:22:37 +01:00
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:
2016-10-30 18:24:19 +01:00
void GenerateScript(std::ostream& os) CM_OVERRIDE;
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
2017-07-20 19:35:53 +02:00
Indent indent) CM_OVERRIDE;
void GenerateScriptForConfigObjectLibrary(std::ostream& os,
const std::string& config,
Indent indent);
typedef void (cmInstallTargetGenerator::*TweakMethod)(std::ostream&, Indent,
2016-07-09 11:21:54 +02:00
const std::string&,
std::string const&);
2017-07-20 19:35:53 +02:00
void AddTweak(std::ostream& os, Indent indent, const std::string& config,
std::string const& file, TweakMethod tweak);
void AddTweak(std::ostream& os, Indent indent, const std::string& config,
2016-07-09 11:21:54 +02:00
std::vector<std::string> const& files, TweakMethod tweak);
2010-03-17 14:00:29 +02:00
std::string GetDestDirPath(std::string const& file);
2017-07-20 19:35:53 +02:00
void PreReplacementTweaks(std::ostream& os, Indent indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& file);
2017-07-20 19:35:53 +02:00
void PostReplacementTweaks(std::ostream& os, Indent indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& file);
2017-07-20 19:35:53 +02:00
void AddInstallNamePatchRule(std::ostream& os, Indent indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
const std::string& toDestDirPath);
2017-07-20 19:35:53 +02:00
void AddChrpathPatchRule(std::ostream& os, Indent indent,
2015-04-27 22:25:09 +02:00
const std::string& config,
std::string const& toDestDirPath);
2017-07-20 19:35:53 +02:00
void AddRPathCheckRule(std::ostream& os, Indent 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
2017-07-20 19:35:53 +02:00
void AddStripRule(std::ostream& os, Indent indent,
const std::string& toDestDirPath);
2017-07-20 19:35:53 +02:00
void AddRanlibRule(std::ostream& os, Indent indent,
const std::string& toDestDirPath);
2017-07-20 19:35:53 +02:00
void AddUniversalInstallRule(std::ostream& os, Indent indent,
2016-03-13 13:35:51 +01:00
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