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. */
|
2013-11-03 12:27:13 +02:00
|
|
|
#ifndef cmGeneratorExpressionEvaluationFile_h
|
|
|
|
#define cmGeneratorExpressionEvaluationFile_h
|
|
|
|
|
2017-07-20 19:35:53 +02:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
#include <map>
|
2018-01-26 17:06:56 +01:00
|
|
|
#include <memory> // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2016-07-09 11:21:54 +02:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
#include "cmGeneratorExpression.h"
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmPolicies.h"
|
2017-07-20 19:35:53 +02:00
|
|
|
#include "cm_sys_stat.h"
|
2017-04-14 19:02:05 +02:00
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
class cmLocalGenerator;
|
|
|
|
|
2013-11-03 12:27:13 +02:00
|
|
|
class cmGeneratorExpressionEvaluationFile
|
|
|
|
{
|
|
|
|
public:
|
2016-07-09 11:21:54 +02:00
|
|
|
cmGeneratorExpressionEvaluationFile(
|
|
|
|
const std::string& input,
|
2018-01-26 17:06:56 +01:00
|
|
|
std::unique_ptr<cmCompiledGeneratorExpression> outputFileExpr,
|
|
|
|
std::unique_ptr<cmCompiledGeneratorExpression> condition,
|
|
|
|
bool inputIsContent, cmPolicies::PolicyStatus policyStatusCMP0070);
|
2013-11-03 12:27:13 +02:00
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
void Generate(cmLocalGenerator* lg);
|
2013-11-03 12:27:13 +02:00
|
|
|
|
|
|
|
std::vector<std::string> GetFiles() const { return this->Files; }
|
|
|
|
|
2015-11-17 17:22:37 +01:00
|
|
|
void CreateOutputFile(cmLocalGenerator* lg, std::string const& config);
|
2015-04-27 22:25:09 +02:00
|
|
|
|
2013-11-03 12:27:13 +02:00
|
|
|
private:
|
2015-11-17 17:22:37 +01:00
|
|
|
void Generate(cmLocalGenerator* lg, const std::string& config,
|
|
|
|
const std::string& lang,
|
|
|
|
cmCompiledGeneratorExpression* inputExpression,
|
2016-07-09 11:21:54 +02:00
|
|
|
std::map<std::string, std::string>& outputFiles, mode_t perm);
|
2013-11-03 12:27:13 +02:00
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
enum PathRole
|
|
|
|
{
|
|
|
|
PathForInput,
|
|
|
|
PathForOutput
|
|
|
|
};
|
|
|
|
std::string FixRelativePath(std::string const& filePath, PathRole role,
|
|
|
|
cmLocalGenerator* lg);
|
|
|
|
|
2013-11-03 12:27:13 +02:00
|
|
|
private:
|
|
|
|
const std::string Input;
|
2018-01-26 17:06:56 +01:00
|
|
|
const std::unique_ptr<cmCompiledGeneratorExpression> OutputFileExpr;
|
|
|
|
const std::unique_ptr<cmCompiledGeneratorExpression> Condition;
|
2013-11-03 12:27:13 +02:00
|
|
|
std::vector<std::string> Files;
|
|
|
|
const bool InputIsContent;
|
2018-01-26 17:06:56 +01:00
|
|
|
cmPolicies::PolicyStatus PolicyStatusCMP0070;
|
2013-11-03 12:27:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|