summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-20 14:26:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-20 14:26:41 (GMT)
commit01d2944458289ac2601855b3fce2e3f66d850ed4 (patch)
tree320444c761dd53f2c60856cb1cf210f0f25c1c7a /Source/cmInstallCommand.cxx
parent541e681da26d3f264ad20228b66e6cfdfec83878 (diff)
parent71f088f53ae7f59e002ec893933d0f670347ea93 (diff)
downloadCMake-01d2944458289ac2601855b3fce2e3f66d850ed4.zip
CMake-01d2944458289ac2601855b3fce2e3f66d850ed4.tar.gz
CMake-01d2944458289ac2601855b3fce2e3f66d850ed4.tar.bz2
Merge topic 'smart_ptr/cmExportSet'
71f088f53a cmExportSet: subsume cmExportSetMap source files 6511fa6f33 cmExportSet: default destructor 9b8a1f7c28 cmExportSetMap: improve ownership of cmExportSet Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3816
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index e7bb1ac..f7050d4 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -11,7 +11,6 @@
#include "cmArgumentParser.h"
#include "cmExportSet.h"
-#include "cmExportSetMap.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmInstallCommandArguments.h"
@@ -736,7 +735,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// Add this install rule to an export if one was specified and
// this is not a namelink-only rule.
if (!exports.empty() && !namelinkOnly) {
- cmTargetExport* te = new cmTargetExport;
+ auto te = cm::make_unique<cmTargetExport>();
te->TargetName = target.GetName();
te->ArchiveGenerator = archiveGenerator;
te->BundleGenerator = bundleGenerator;
@@ -745,12 +744,12 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
te->LibraryGenerator = libraryGenerator;
te->RuntimeGenerator = runtimeGenerator;
te->ObjectsGenerator = objectGenerator;
- this->Makefile->GetGlobalGenerator()
- ->GetExportSets()[exports]
- ->AddTargetExport(te);
-
te->InterfaceIncludeDirectories =
cmJoin(includesArgs.GetIncludeDirs(), ";");
+
+ this->Makefile->GetGlobalGenerator()
+ ->GetExportSets()[exports]
+ .AddTargetExport(std::move(te));
}
}
@@ -1273,7 +1272,7 @@ bool cmInstallCommand::HandleExportAndroidMKMode(
fname = "Android.mk";
}
- cmExportSet* exportSet =
+ cmExportSet& exportSet =
this->Makefile->GetGlobalGenerator()->GetExportSets()[exp];
cmInstallGenerator::MessageLevel message =
@@ -1281,7 +1280,7 @@ bool cmInstallCommand::HandleExportAndroidMKMode(
// Create the export install generator.
cmInstallExportGenerator* exportGenerator = new cmInstallExportGenerator(
- exportSet, ica.GetDestination().c_str(), ica.GetPermissions().c_str(),
+ &exportSet, ica.GetDestination().c_str(), ica.GetPermissions().c_str(),
ica.GetConfigurations(), ica.GetComponent().c_str(), message,
ica.GetExcludeFromAll(), fname.c_str(), name_space.c_str(), exportOld,
true);
@@ -1367,10 +1366,10 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
}
}
- cmExportSet* exportSet =
+ cmExportSet& exportSet =
this->Makefile->GetGlobalGenerator()->GetExportSets()[exp];
if (exportOld) {
- for (cmTargetExport* te : *exportSet->GetTargetExports()) {
+ for (auto const& te : exportSet.GetTargetExports()) {
cmTarget* tgt =
this->Makefile->GetGlobalGenerator()->FindTarget(te->TargetName);
const bool newCMP0022Behavior =
@@ -1392,7 +1391,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
// Create the export install generator.
cmInstallExportGenerator* exportGenerator = new cmInstallExportGenerator(
- exportSet, ica.GetDestination().c_str(), ica.GetPermissions().c_str(),
+ &exportSet, ica.GetDestination().c_str(), ica.GetPermissions().c_str(),
ica.GetConfigurations(), ica.GetComponent().c_str(), message,
ica.GetExcludeFromAll(), fname.c_str(), name_space.c_str(), exportOld,
false);