summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorYury G. Kudryashov <urkud.urkud@gmail.com>2012-03-01 10:52:32 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-28 13:21:39 (GMT)
commit81cdab5beaffc7665550710b84006a0a7ce76cfa (patch)
treeb0a6474986aa464700ef4d3e61ffb09572981d0f /Source
parent5c898fbd99f6d12e8835a0dd3b229d93812e7533 (diff)
downloadCMake-81cdab5beaffc7665550710b84006a0a7ce76cfa.zip
CMake-81cdab5beaffc7665550710b84006a0a7ce76cfa.tar.gz
CMake-81cdab5beaffc7665550710b84006a0a7ce76cfa.tar.bz2
exports: Hold an ExportSet pointer in cm*Export*Generator
Get name from this->ExportSet.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportInstallFileGenerator.cxx29
-rw-r--r--Source/cmExportInstallFileGenerator.h13
-rw-r--r--Source/cmInstallCommand.cxx4
-rw-r--r--Source/cmInstallExportGenerator.cxx16
-rw-r--r--Source/cmInstallExportGenerator.h6
5 files changed, 30 insertions, 38 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index ba8b1839..d4f7fd5 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -20,7 +20,7 @@
//----------------------------------------------------------------------------
cmExportInstallFileGenerator
::cmExportInstallFileGenerator(cmInstallExportGenerator* iegen):
- InstallExportGenerator(iegen)
+ IEGen(iegen)
{
}
@@ -38,8 +38,8 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
// Create all the imported targets.
for(std::vector<cmTargetExport const*>::const_iterator
- tei = this->ExportSet->GetTargetExports()->begin();
- tei != this->ExportSet->GetTargetExports()->end(); ++tei)
+ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
+ tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
{
cmTargetExport const* te = *tei;
if(this->ExportedTargets.insert(te->Target).second)
@@ -49,8 +49,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
else
{
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\" ...) "
- << "includes target \"" << te->Target->GetName()
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\" ...) " << "includes target \"" << te->Target->GetName()
<< "\" more than once in the export set.";
cmSystemTools::Error(e.str().c_str());
return false;
@@ -86,7 +87,7 @@ bool
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config)
{
// Skip configurations not enabled for this export.
- if(!this->InstallExportGenerator->InstallsForConfig(config))
+ if(!this->IEGen->InstallsForConfig(config))
{
return true;
}
@@ -142,7 +143,7 @@ cmExportInstallFileGenerator
{
// Add code to compute the installation prefix relative to the
// import file location.
- const char* installDest = this->InstallExportGenerator->GetDestination();
+ const char* installDest = this->IEGen->GetDestination();
if(!cmSystemTools::FileIsFullPath(installDest))
{
std::string dest = installDest;
@@ -163,8 +164,8 @@ cmExportInstallFileGenerator
// Add each target in the set to the export.
for(std::vector<cmTargetExport const*>::const_iterator
- tei = this->ExportSet->GetTargetExports()->begin();
- tei != this->ExportSet->GetTargetExports()->end(); ++tei)
+ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
+ tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
{
// Collect import properties for this target.
cmTargetExport const* te = *tei;
@@ -311,9 +312,11 @@ void
cmExportInstallFileGenerator
::ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen)
{
- const char* installDest = this->InstallExportGenerator->GetDestination();
+ const char* installDest = this->IEGen->GetDestination();
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\") given absolute "
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\") given absolute "
<< "DESTINATION \"" << installDest << "\" but the export "
<< "references an installation of target \""
<< itgen->GetTarget()->GetName() << "\" which has relative "
@@ -327,7 +330,9 @@ cmExportInstallFileGenerator
::ComplainAboutMissingTarget(cmTarget* depender, cmTarget* dependee)
{
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\" ...) "
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\" ...) "
<< "includes target \"" << depender->GetName()
<< "\" which requires target \"" << dependee->GetName()
<< "\" that is not in the export set.";
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index 7b86b16..77b55c8 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -41,15 +41,6 @@ public:
files. */
cmExportInstallFileGenerator(cmInstallExportGenerator* iegen);
- /** Set the name of the export associated with the files. This is
- the name given to the install(EXPORT) command mode. */
- void SetName(const char* name) { this->Name = name; }
-
- /** Set the set of targets to be exported. These are the targets
- associated with the export name. */
- void SetExportSet(cmExportSet const* eSet)
- { this->ExportSet = eSet; }
-
/** Get the per-config file generated for each configuraiton. This
maps from the configuration name to the file temporary location
for installation. */
@@ -82,9 +73,7 @@ protected:
void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen);
- cmInstallExportGenerator* InstallExportGenerator;
- std::string Name;
- cmExportSet const* ExportSet;
+ cmInstallExportGenerator* IEGen;
std::string ImportPrefix;
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 6eaa103..dcd418b 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -1271,7 +1271,9 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
// Create the export install generator.
cmInstallExportGenerator* exportGenerator =
new cmInstallExportGenerator(
- exp.GetCString(), ica.GetDestination().c_str(),
+ this->Makefile->GetLocalGenerator()
+ ->GetGlobalGenerator()->GetExportSets()[exp.GetString()],
+ ica.GetDestination().c_str(),
ica.GetPermissions().c_str(), ica.GetConfigurations(),
ica.GetComponent().c_str(), fname.c_str(),
name_space.GetCString(), this->Makefile);
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 0179cd1..caedaf5 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -27,7 +27,7 @@
//----------------------------------------------------------------------------
cmInstallExportGenerator::cmInstallExportGenerator(
- const char* name,
+ cmExportSet* exportSet,
const char* destination,
const char* file_permissions,
std::vector<std::string> const& configurations,
@@ -35,7 +35,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
const char* filename, const char* name_space,
cmMakefile* mf)
:cmInstallGenerator(destination, configurations, component)
- ,Name(name)
+ ,ExportSet(exportSet)
,FilePermissions(file_permissions)
,FileName(filename)
,Namespace(name_space)
@@ -114,16 +114,12 @@ void cmInstallExportGenerator::ComputeTempDir()
//----------------------------------------------------------------------------
void cmInstallExportGenerator::GenerateScript(std::ostream& os)
{
- // Get the export set requested.
- cmExportSet const* exportSet =
- this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
- ->GetExportSets()[this->Name];
-
// Skip empty sets.
- if(!exportSet)
+ if(ExportSet->GetTargetExports()->empty())
{
cmOStringStream e;
- e << "INSTALL(EXPORT) given unknown export \"" << this->Name << "\"";
+ e << "INSTALL(EXPORT) given unknown export \""
+ << ExportSet->GetName() << "\"";
cmSystemTools::Error(e.str().c_str());
return;
}
@@ -138,8 +134,6 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
this->MainImportFile += this->FileName;
// Generate the import file for this export set.
- this->EFGen->SetName(this->Name.c_str());
- this->EFGen->SetExportSet(exportSet);
this->EFGen->SetExportFile(this->MainImportFile.c_str());
this->EFGen->SetNamespace(this->Namespace.c_str());
if(this->ConfigurationTypes->empty())
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index 7b65ab7..8ae271b 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -26,13 +26,15 @@ class cmMakefile;
class cmInstallExportGenerator: public cmInstallGenerator
{
public:
- cmInstallExportGenerator(const char* name,
+ cmInstallExportGenerator(cmExportSet* exportSet,
const char* dest, const char* file_permissions,
const std::vector<std::string>& configurations,
const char* component,
const char* filename, const char* name_space,
cmMakefile* mf);
~cmInstallExportGenerator();
+
+ cmExportSet* GetExportSet() {return ExportSet;}
protected:
virtual void GenerateScript(std::ostream& os);
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
@@ -41,7 +43,7 @@ protected:
void GenerateImportFile(const char* config, cmExportSet const* exportSet);
void ComputeTempDir();
- std::string Name;
+ cmExportSet* ExportSet;
std::string FilePermissions;
std::string FileName;
std::string Namespace;