mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
Source: Avoid duplicate calls
This commit is contained in:
@@ -928,8 +928,8 @@ std::string cmCPackDebGenerator::GetComponentInstallSuffix(
|
||||
// the current COMPONENT belongs to.
|
||||
std::string groupVar =
|
||||
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
|
||||
if (this->GetOption(groupVar)) {
|
||||
return *this->GetOption(groupVar);
|
||||
if (cmValue v = this->GetOption(groupVar)) {
|
||||
return *v;
|
||||
}
|
||||
return componentName;
|
||||
}
|
||||
|
||||
@@ -196,8 +196,8 @@ int cmCPackGenerator::InstallProject()
|
||||
std::string bareTempInstallDirectory =
|
||||
this->GetOption("CPACK_TEMPORARY_DIRECTORY");
|
||||
std::string tempInstallDirectory = bareTempInstallDirectory;
|
||||
bool setDestDir = this->GetOption("CPACK_SET_DESTDIR").IsOn() ||
|
||||
cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
|
||||
cmValue v = this->GetOption("CPACK_SET_DESTDIR");
|
||||
bool setDestDir = v.IsOn() || cmIsInternallyOn(v);
|
||||
if (!setDestDir) {
|
||||
tempInstallDirectory += this->GetPackagingInstallPrefix();
|
||||
}
|
||||
@@ -962,9 +962,8 @@ int cmCPackGenerator::InstallCMakeProject(
|
||||
std::string absoluteDestFileComponent =
|
||||
std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" +
|
||||
this->GetComponentInstallSuffix(component);
|
||||
if (this->GetOption(absoluteDestFileComponent)) {
|
||||
std::string absoluteDestFilesListComponent =
|
||||
cmStrCat(this->GetOption(absoluteDestFileComponent), ';', *d);
|
||||
if (cmValue v = this->GetOption(absoluteDestFileComponent)) {
|
||||
std::string absoluteDestFilesListComponent = cmStrCat(*v, ';', *d);
|
||||
this->SetOption(absoluteDestFileComponent,
|
||||
absoluteDestFilesListComponent);
|
||||
} else {
|
||||
|
||||
@@ -662,12 +662,11 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
|
||||
if (cmNonempty(userUploadDirectory)) {
|
||||
uploadDirectory = *userUploadDirectory;
|
||||
} else {
|
||||
if (!RequireOption("CPACK_PACKAGE_DIRECTORY")) {
|
||||
cmValue pkgDirectory = RequireOption("CPACK_PACKAGE_DIRECTORY");
|
||||
if (!pkgDirectory) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uploadDirectory =
|
||||
cmStrCat(GetOption("CPACK_PACKAGE_DIRECTORY"), "/CPackUploads");
|
||||
uploadDirectory = cmStrCat(*pkgDirectory, "/CPackUploads");
|
||||
}
|
||||
|
||||
if (!cmSystemTools::FileExists(uploadDirectory)) {
|
||||
|
||||
@@ -458,8 +458,8 @@ std::string cmCPackRPMGenerator::GetComponentInstallSuffix(
|
||||
// the current COMPONENT belongs to.
|
||||
std::string groupVar =
|
||||
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
|
||||
if (this->GetOption(groupVar)) {
|
||||
return *this->GetOption(groupVar);
|
||||
if (cmValue v = this->GetOption(groupVar)) {
|
||||
return *v;
|
||||
}
|
||||
return componentName;
|
||||
}
|
||||
|
||||
@@ -2244,10 +2244,9 @@ int cmake::DoPreConfigureChecks()
|
||||
}
|
||||
|
||||
// do a sanity check on some values
|
||||
if (this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) {
|
||||
std::string cacheStart =
|
||||
cmStrCat(*this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"),
|
||||
"/", this->CMakeListName);
|
||||
if (cmValue dir =
|
||||
this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY")) {
|
||||
std::string cacheStart = cmStrCat(*dir, '/', this->CMakeListName);
|
||||
if (!cmSystemTools::SameFile(cacheStart, srcList)) {
|
||||
std::string message =
|
||||
cmStrCat("The source \"", srcList, "\" does not match the source \"",
|
||||
|
||||
Reference in New Issue
Block a user