cmInstallFilesGenerator: Require cmLocalGenerator, not cmMakefile.

This commit is contained in:
Stephen Kelly 2015-08-01 09:01:03 +02:00
parent 29c1385675
commit 75e511eeaf
5 changed files with 17 additions and 13 deletions

View File

@ -42,7 +42,7 @@ static cmInstallFilesGenerator* CreateInstallFilesGenerator(
{
cmInstallGenerator::MessageLevel message =
cmInstallGenerator::SelectMessageLevel(mf);
return new cmInstallFilesGenerator(mf,
return new cmInstallFilesGenerator(
absFiles, args.GetDestination().c_str(),
programs, args.GetPermissions().c_str(),
args.GetConfigurations(), args.GetComponent().c_str(),

View File

@ -128,7 +128,7 @@ void cmInstallFilesCommand::CreateInstallGenerator() const
cmInstallGenerator::MessageLevel message =
cmInstallGenerator::SelectMessageLevel(this->Makefile);
this->Makefile->AddInstallGenerator(
new cmInstallFilesGenerator(this->Makefile, this->Files,
new cmInstallFilesGenerator(this->Files,
destination.c_str(), false,
no_permissions, no_configurations,
no_component.c_str(), message, no_rename));

View File

@ -14,11 +14,11 @@
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmLocalGenerator.h"
//----------------------------------------------------------------------------
cmInstallFilesGenerator
::cmInstallFilesGenerator(cmMakefile* mf,
std::vector<std::string> const& files,
::cmInstallFilesGenerator(std::vector<std::string> const& files,
const char* dest, bool programs,
const char* file_permissions,
std::vector<std::string> const& configurations,
@ -27,7 +27,7 @@ cmInstallFilesGenerator
const char* rename,
bool optional):
cmInstallGenerator(dest, configurations, component, message),
Makefile(mf),
LocalGenerator(0),
Files(files),
FilePermissions(file_permissions),
Rename(rename),
@ -51,6 +51,11 @@ cmInstallFilesGenerator
{
}
void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg)
{
this->LocalGenerator = lg;
}
//----------------------------------------------------------------------------
void cmInstallFilesGenerator::AddFilesInstallRule(
std::ostream& os, Indent const& indent,
@ -94,8 +99,8 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
i != this->Files.end(); ++i)
{
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, config),
files);
cmSystemTools::ExpandListArgument(cge->Evaluate(
this->LocalGenerator->GetMakefile(), config), files);
}
this->AddFilesInstallRule(os, indent, files);
}

View File

@ -14,16 +14,13 @@
#include "cmInstallGenerator.h"
class cmMakefile;
/** \class cmInstallFilesGenerator
* \brief Generate file installation rules.
*/
class cmInstallFilesGenerator: public cmInstallGenerator
{
public:
cmInstallFilesGenerator(cmMakefile* mf,
std::vector<std::string> const& files,
cmInstallFilesGenerator(std::vector<std::string> const& files,
const char* dest, bool programs,
const char* file_permissions,
std::vector<std::string> const& configurations,
@ -33,6 +30,8 @@ public:
bool optional = false);
virtual ~cmInstallFilesGenerator();
void Compute(cmLocalGenerator* lg);
protected:
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os,
@ -41,7 +40,7 @@ protected:
void AddFilesInstallRule(std::ostream& os, Indent const& indent,
std::vector<std::string> const& files);
cmMakefile* Makefile;
cmLocalGenerator* LocalGenerator;
std::vector<std::string> Files;
std::string FilePermissions;
std::string Rename;

View File

@ -91,7 +91,7 @@ void cmInstallProgramsCommand::FinalPass()
cmInstallGenerator::MessageLevel message =
cmInstallGenerator::SelectMessageLevel(this->Makefile);
this->Makefile->AddInstallGenerator(
new cmInstallFilesGenerator(this->Makefile, this->Files,
new cmInstallFilesGenerator(this->Files,
destination.c_str(), true,
no_permissions, no_configurations,
no_component.c_str(), message, no_rename));