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. */
|
2021-09-14 00:13:48 +02:00
|
|
|
#pragma once
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
#include "cmInstallGenerator.h"
|
2021-09-14 00:13:48 +02:00
|
|
|
#include "cmListFileCache.h"
|
2020-02-01 23:06:01 +01:00
|
|
|
#include "cmScriptGenerator.h"
|
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
class cmLocalGenerator;
|
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
/** \class cmInstallScriptGenerator
|
|
|
|
* \brief Generate target installation rules.
|
|
|
|
*/
|
2016-07-09 11:21:54 +02:00
|
|
|
class cmInstallScriptGenerator : public cmInstallGenerator
|
2008-10-12 18:41:06 +02:00
|
|
|
{
|
|
|
|
public:
|
2021-09-14 00:13:48 +02:00
|
|
|
cmInstallScriptGenerator(
|
|
|
|
std::string script, bool code, std::string const& component,
|
|
|
|
bool exclude_from_all, bool all_components,
|
|
|
|
cmListFileBacktrace backtrace = cmListFileBacktrace());
|
2018-01-26 17:06:56 +01:00
|
|
|
~cmInstallScriptGenerator() override;
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2019-11-11 23:01:05 +01:00
|
|
|
bool Compute(cmLocalGenerator* lg) override;
|
|
|
|
|
2021-09-14 00:13:48 +02:00
|
|
|
bool IsCode() const { return this->Code; }
|
|
|
|
|
|
|
|
std::string GetScript(std::string const& config) const;
|
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
protected:
|
2019-11-11 23:01:05 +01:00
|
|
|
void GenerateScriptActions(std::ostream& os, Indent indent) override;
|
|
|
|
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
|
|
|
|
Indent indent) override;
|
|
|
|
void AddScriptInstallRule(std::ostream& os, Indent indent,
|
2021-09-14 00:13:48 +02:00
|
|
|
std::string const& script) const;
|
2019-11-11 23:01:05 +01:00
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
std::string const Script;
|
|
|
|
bool const Code;
|
2019-11-11 23:01:05 +01:00
|
|
|
cmLocalGenerator* LocalGenerator;
|
|
|
|
bool AllowGenex;
|
2008-10-12 18:41:06 +02:00
|
|
|
};
|