diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index aeb68a35d7..9d8311d6d7 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -63,8 +63,8 @@ bool cmExportFileGenerator::GenerateImportFile() openmodeApp); } else { // Generate atomically and with copy-if-different. - std::unique_ptr ap( - new cmGeneratedFileStream(this->MainImportFile, true)); + auto ap = + cm::make_unique(this->MainImportFile, true); ap->SetCopyIfDifferent(true); foutPtr = std::move(ap); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d7553602bb..11b54463e6 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3870,11 +3870,11 @@ cmTarget* cmMakefile::AddImportedTarget(std::string const& name, bool global) { // Create the target. - std::unique_ptr target( - new cmTarget(name, type, - global ? cmTarget::Visibility::ImportedGlobally - : cmTarget::Visibility::Imported, - this, cmTarget::PerConfig::Yes)); + auto target = + cm::make_unique(name, type, + global ? cmTarget::Visibility::ImportedGlobally + : cmTarget::Visibility::Imported, + this, cmTarget::PerConfig::Yes); // Add to the set of available imported targets. this->ImportedTargets[name] = target.get(); @@ -3890,9 +3890,9 @@ cmTarget* cmMakefile::AddForeignTarget(std::string const& origin, std::string const& name) { auto foreign_name = cmStrCat("@foreign_", origin, "::", name); - std::unique_ptr target(new cmTarget( + auto target = cm::make_unique( foreign_name, cmStateEnums::TargetType::INTERFACE_LIBRARY, - cmTarget::Visibility::Foreign, this, cmTarget::PerConfig::Yes)); + cmTarget::Visibility::Foreign, this, cmTarget::PerConfig::Yes); this->ImportedTargets[foreign_name] = target.get(); this->GetGlobalGenerator()->IndexTarget(target.get());