cmCPackGenerator: Slightly simplify function InstallProject

This commit is contained in:
Deniz Bahadir
2024-04-30 18:36:25 +02:00
parent 1350ed96ff
commit 87cfe9dd91

View File

@@ -197,20 +197,20 @@ int cmCPackGenerator::InstallProject()
std::string bareTempInstallDirectory =
this->GetOption("CPACK_TEMPORARY_DIRECTORY");
std::string tempInstallDirectoryStr = bareTempInstallDirectory;
std::string tempInstallDirectory = bareTempInstallDirectory;
bool setDestDir = this->GetOption("CPACK_SET_DESTDIR").IsOn() ||
cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
if (!setDestDir) {
tempInstallDirectoryStr += this->GetPackagingInstallPrefix();
tempInstallDirectory += this->GetPackagingInstallPrefix();
}
const char* tempInstallDirectory = tempInstallDirectoryStr.c_str();
int res = 1;
if (!cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating temporary directory: "
<< (tempInstallDirectory ? tempInstallDirectory : "(NULL)")
<< std::endl);
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"Problem creating temporary directory: "
<< (!tempInstallDirectory.empty() ? tempInstallDirectory : "(NULL)")
<< std::endl);
return 0;
}