cmInstallExportGenerator: Require cmLocalGenerator, not cmMakefile.

This commit is contained in:
Stephen Kelly 2015-08-05 23:05:22 +02:00
parent c259b83026
commit 1f39ee5beb
4 changed files with 17 additions and 10 deletions

View File

@ -72,8 +72,8 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
// Set an _IMPORT_PREFIX variable for import location properties // Set an _IMPORT_PREFIX variable for import location properties
// to reference if they are relative to the install prefix. // to reference if they are relative to the install prefix.
std::string installPrefix = std::string installPrefix = this->IEGen->GetLocalGenerator()
this->IEGen->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); ->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
std::string const& expDest = this->IEGen->GetDestination(); std::string const& expDest = this->IEGen->GetDestination();
if(cmSystemTools::FileIsFullPath(expDest)) if(cmSystemTools::FileIsFullPath(expDest))
{ {

View File

@ -1406,7 +1406,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
ica.GetDestination().c_str(), ica.GetDestination().c_str(),
ica.GetPermissions().c_str(), ica.GetConfigurations(), ica.GetPermissions().c_str(), ica.GetConfigurations(),
ica.GetComponent().c_str(), message, fname.c_str(), ica.GetComponent().c_str(), message, fname.c_str(),
name_space.GetCString(), exportOld.IsEnabled(), this->Makefile); name_space.GetCString(), exportOld.IsEnabled());
this->Makefile->AddInstallGenerator(exportGenerator); this->Makefile->AddInstallGenerator(exportGenerator);
return true; return true;

View File

@ -34,15 +34,14 @@ cmInstallExportGenerator::cmInstallExportGenerator(
const char* component, const char* component,
MessageLevel message, MessageLevel message,
const char* filename, const char* name_space, const char* filename, const char* name_space,
bool exportOld, bool exportOld)
cmMakefile* mf)
:cmInstallGenerator(destination, configurations, component, message) :cmInstallGenerator(destination, configurations, component, message)
,ExportSet(exportSet) ,ExportSet(exportSet)
,FilePermissions(file_permissions) ,FilePermissions(file_permissions)
,FileName(filename) ,FileName(filename)
,Namespace(name_space) ,Namespace(name_space)
,ExportOld(exportOld) ,ExportOld(exportOld)
,Makefile(mf) ,LocalGenerator(0)
{ {
this->EFGen = new cmExportInstallFileGenerator(this); this->EFGen = new cmExportInstallFileGenerator(this);
exportSet->AddInstallation(this); exportSet->AddInstallation(this);
@ -54,12 +53,18 @@ cmInstallExportGenerator::~cmInstallExportGenerator()
delete this->EFGen; delete this->EFGen;
} }
void cmInstallExportGenerator::Compute(cmLocalGenerator* lg)
{
this->LocalGenerator = lg;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmInstallExportGenerator::ComputeTempDir() void cmInstallExportGenerator::ComputeTempDir()
{ {
// Choose a temporary directory in which to generate the import // Choose a temporary directory in which to generate the import
// files to be installed. // files to be installed.
this->TempDir = this->Makefile->GetCurrentBinaryDirectory(); this->TempDir =
this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory();
this->TempDir += cmake::GetCMakeFilesDirectory(); this->TempDir += cmake::GetCMakeFilesDirectory();
this->TempDir += "/Export"; this->TempDir += "/Export";
if(this->Destination.empty()) if(this->Destination.empty())

View File

@ -32,12 +32,14 @@ public:
const char* component, const char* component,
MessageLevel message, MessageLevel message,
const char* filename, const char* name_space, const char* filename, const char* name_space,
bool exportOld, cmMakefile* mf); bool exportOld);
~cmInstallExportGenerator(); ~cmInstallExportGenerator();
cmExportSet* GetExportSet() {return this->ExportSet;} cmExportSet* GetExportSet() {return this->ExportSet;}
cmMakefile* GetMakefile() const { return this->Makefile; } void Compute(cmLocalGenerator* lg);
cmLocalGenerator* GetLocalGenerator() const { return this->LocalGenerator; }
const std::string& GetNamespace() const { return this->Namespace; } const std::string& GetNamespace() const { return this->Namespace; }
@ -57,7 +59,7 @@ protected:
std::string FileName; std::string FileName;
std::string Namespace; std::string Namespace;
bool ExportOld; bool ExportOld;
cmMakefile* Makefile; cmLocalGenerator* LocalGenerator;
std::string TempDir; std::string TempDir;
std::string MainImportFile; std::string MainImportFile;