exports: Remove cmTargetExport constructor
The constructor was used exactly once. Setting members explicitly makes the code more readable.
This commit is contained in:
parent
81c66c8b88
commit
e846e7031f
|
@ -1467,18 +1467,10 @@ void cmGlobalGenerator::AddInstallComponent(const char* component)
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalGenerator::AddTargetToExports(const char* exportSetName,
|
void cmGlobalGenerator::AddTargetToExports(const char* exportSetName,
|
||||||
cmTarget* target,
|
cmTargetExport *te)
|
||||||
cmInstallTargetGenerator* archive,
|
|
||||||
cmInstallTargetGenerator* runTime,
|
|
||||||
cmInstallTargetGenerator* library,
|
|
||||||
cmInstallTargetGenerator* framework,
|
|
||||||
cmInstallTargetGenerator* bundle,
|
|
||||||
cmInstallFilesGenerator* headers)
|
|
||||||
{
|
{
|
||||||
if ((exportSetName) && (*exportSetName) && (target))
|
if ((exportSetName) && (*exportSetName) && (te))
|
||||||
{
|
{
|
||||||
cmTargetExport* te = new cmTargetExport(target, archive, runTime, library,
|
|
||||||
framework, bundle, headers);
|
|
||||||
this->ExportSets[exportSetName].push_back(te);
|
this->ExportSets[exportSetName].push_back(te);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,13 +154,7 @@ public:
|
||||||
{ return &this->InstallComponents; }
|
{ return &this->InstallComponents; }
|
||||||
|
|
||||||
///! Add one installed target to the sets of the exports
|
///! Add one installed target to the sets of the exports
|
||||||
void AddTargetToExports(const char* exportSet, cmTarget* target,
|
void AddTargetToExports(const char* exportSet, cmTargetExport* te);
|
||||||
cmInstallTargetGenerator* archive,
|
|
||||||
cmInstallTargetGenerator* runTime,
|
|
||||||
cmInstallTargetGenerator* library,
|
|
||||||
cmInstallTargetGenerator* framework,
|
|
||||||
cmInstallTargetGenerator* bundle,
|
|
||||||
cmInstallFilesGenerator* publicHeaders);
|
|
||||||
///! Get the export target set with the given name
|
///! Get the export target set with the given name
|
||||||
const std::vector<cmTargetExport*>* GetExportSet(const char* name) const;
|
const std::vector<cmTargetExport*>* GetExportSet(const char* name) const;
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "cmInstallTargetGenerator.h"
|
#include "cmInstallTargetGenerator.h"
|
||||||
#include "cmInstallExportGenerator.h"
|
#include "cmInstallExportGenerator.h"
|
||||||
#include "cmInstallCommandArguments.h"
|
#include "cmInstallCommandArguments.h"
|
||||||
|
#include "cmTargetExport.h"
|
||||||
|
|
||||||
#include <cmsys/Glob.hxx>
|
#include <cmsys/Glob.hxx>
|
||||||
|
|
||||||
|
@ -731,6 +732,24 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
|
||||||
this->Makefile->AddInstallGenerator(publicHeaderGenerator);
|
this->Makefile->AddInstallGenerator(publicHeaderGenerator);
|
||||||
this->Makefile->AddInstallGenerator(resourceGenerator);
|
this->Makefile->AddInstallGenerator(resourceGenerator);
|
||||||
|
|
||||||
|
// Add this install rule to an export if one was specified and
|
||||||
|
// this is not a namelink-only rule.
|
||||||
|
if(!exports.GetString().empty() && !namelinkOnly)
|
||||||
|
{
|
||||||
|
cmTargetExport *te = new cmTargetExport;
|
||||||
|
te->Target = ⌖
|
||||||
|
te->ArchiveGenerator = archiveGenerator;
|
||||||
|
te->BundleGenerator = bundleGenerator;
|
||||||
|
te->FrameworkGenerator = frameworkGenerator;
|
||||||
|
te->HeaderGenerator = publicHeaderGenerator;
|
||||||
|
te->LibraryGenerator = libraryGenerator;
|
||||||
|
te->RuntimeGenerator = runtimeGenerator;
|
||||||
|
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
|
||||||
|
->AddTargetToExports(exports.GetCString(), te);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add this install rule to an export if one was specified and
|
// Add this install rule to an export if one was specified and
|
||||||
// this is not a namelink-only rule.
|
// this is not a namelink-only rule.
|
||||||
if(!exports.GetString().empty() && !namelinkOnly)
|
if(!exports.GetString().empty() && !namelinkOnly)
|
||||||
|
@ -743,6 +762,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Tell the global generator about any installation component names
|
// Tell the global generator about any installation component names
|
||||||
// specified
|
// specified
|
||||||
if (installsArchive)
|
if (installsArchive)
|
||||||
|
|
|
@ -23,18 +23,6 @@ class cmInstallFilesGenerator;
|
||||||
class cmTargetExport
|
class cmTargetExport
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmTargetExport(cmTarget* tgt,
|
|
||||||
cmInstallTargetGenerator* archive,
|
|
||||||
cmInstallTargetGenerator* runtime,
|
|
||||||
cmInstallTargetGenerator* library,
|
|
||||||
cmInstallTargetGenerator* framework,
|
|
||||||
cmInstallTargetGenerator* bundle,
|
|
||||||
cmInstallFilesGenerator* headers
|
|
||||||
) : Target(tgt), ArchiveGenerator(archive),
|
|
||||||
RuntimeGenerator(runtime), LibraryGenerator(library),
|
|
||||||
FrameworkGenerator(framework), BundleGenerator(bundle),
|
|
||||||
HeaderGenerator(headers) {}
|
|
||||||
|
|
||||||
cmTarget* Target; ///< The target
|
cmTarget* Target; ///< The target
|
||||||
|
|
||||||
///@name Generators
|
///@name Generators
|
||||||
|
|
Loading…
Reference in New Issue