Commit d4e6b2ae authored by Alex Turbov's avatar Alex Turbov Committed by Brad King
Browse files

Refactor: Use `unique_ptr` instead of raw pointer

parent e3746821
......@@ -600,9 +600,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
const char* buildConfigCstr = this->GetOption("CPACK_BUILD_CONFIG");
std::string buildConfig = buildConfigCstr ? buildConfigCstr : "";
cmGlobalGenerator* globalGenerator =
std::unique_ptr<cmGlobalGenerator> globalGenerator(
this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator);
cmakeGenerator));
if (!globalGenerator) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Specified package generator not found. "
......@@ -616,12 +616,10 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmSystemTools::SetForceUnixPaths(globalGenerator->GetForceUnixPaths());
if (!this->RunPreinstallTarget(project.ProjectName, project.Directory,
globalGenerator, buildConfig)) {
globalGenerator.get(), buildConfig)) {
return 0;
}
delete globalGenerator;
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install project: " << project.ProjectName << std::endl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment