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