|
|
@@ -216,7 +216,7 @@ int cmCPackGenerator::InstallProject()
|
|
|
mode_t* default_dir_mode = nullptr;
|
|
|
const char* default_dir_install_permissions =
|
|
|
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
|
|
|
- if (default_dir_install_permissions && *default_dir_install_permissions) {
|
|
|
+ if (cmNonempty(default_dir_install_permissions)) {
|
|
|
std::vector<std::string> items =
|
|
|
cmExpandedList(default_dir_install_permissions);
|
|
|
for (const auto& arg : items) {
|
|
|
@@ -293,7 +293,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
|
|
|
{
|
|
|
(void)setDestDir;
|
|
|
const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
|
|
|
- if (installCommands && *installCommands) {
|
|
|
+ if (cmNonempty(installCommands)) {
|
|
|
std::string tempInstallDirectoryEnv =
|
|
|
cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory);
|
|
|
cmSystemTools::PutEnv(tempInstallDirectoryEnv);
|
|
|
@@ -344,7 +344,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
|
|
}
|
|
|
const char* installDirectories =
|
|
|
this->GetOption("CPACK_INSTALLED_DIRECTORIES");
|
|
|
- if (installDirectories && *installDirectories) {
|
|
|
+ if (cmNonempty(installDirectories)) {
|
|
|
std::vector<std::string> installDirectoriesVector =
|
|
|
cmExpandedList(installDirectories);
|
|
|
if (installDirectoriesVector.size() % 2 != 0) {
|
|
|
@@ -541,7 +541,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|
|
const char* cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
|
|
|
const char* cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
|
|
|
std::string absoluteDestFiles;
|
|
|
- if (cmakeProjects && *cmakeProjects) {
|
|
|
+ if (cmNonempty(cmakeProjects)) {
|
|
|
if (!cmakeGenerator) {
|
|
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
|
|
"CPACK_INSTALL_CMAKE_PROJECTS is specified, but "
|
|
|
@@ -594,7 +594,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|
|
std::string installTypesVar = "CPACK_" +
|
|
|
cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
|
|
|
const char* installTypes = this->GetOption(installTypesVar);
|
|
|
- if (installTypes && *installTypes) {
|
|
|
+ if (cmNonempty(installTypes)) {
|
|
|
std::vector<std::string> installTypesVector =
|
|
|
cmExpandedList(installTypes);
|
|
|
for (std::string const& installType : installTypesVector) {
|
|
|
@@ -607,7 +607,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|
|
std::string componentsVar =
|
|
|
"CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component);
|
|
|
const char* components = this->GetOption(componentsVar);
|
|
|
- if (components && *components) {
|
|
|
+ if (cmNonempty(components)) {
|
|
|
cmExpandList(components, componentsVector);
|
|
|
for (std::string const& comp : componentsVector) {
|
|
|
project.Components.push_back(
|
|
|
@@ -771,7 +771,7 @@ int cmCPackGenerator::InstallCMakeProject(
|
|
|
|
|
|
const char* default_dir_inst_permissions =
|
|
|
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
|
|
|
- if (default_dir_inst_permissions && *default_dir_inst_permissions) {
|
|
|
+ if (cmNonempty(default_dir_inst_permissions)) {
|
|
|
mf.AddDefinition("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS",
|
|
|
default_dir_inst_permissions);
|
|
|
}
|
|
|
@@ -983,7 +983,7 @@ void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
|
|
|
const char* value)
|
|
|
{
|
|
|
const char* def = this->MakefileMap->GetDefinition(op);
|
|
|
- if (def && *def) {
|
|
|
+ if (cmNonempty(def)) {
|
|
|
return;
|
|
|
}
|
|
|
this->SetOption(op, value);
|
|
|
@@ -1215,7 +1215,7 @@ bool cmCPackGenerator::IsOn(const std::string& name) const
|
|
|
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
|
|
|
{
|
|
|
const char* ret = this->MakefileMap->GetDefinition(op);
|
|
|
- if (ret && *ret) {
|
|
|
+ if (cmNonempty(ret)) {
|
|
|
return cmIsOff(ret);
|
|
|
}
|
|
|
return false;
|
|
|
@@ -1509,7 +1509,7 @@ cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
|
|
|
installType->Name = name;
|
|
|
|
|
|
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
|
|
|
- if (displayName && *displayName) {
|
|
|
+ if (cmNonempty(displayName)) {
|
|
|
installType->DisplayName = displayName;
|
|
|
} else {
|
|
|
installType->DisplayName = installType->Name;
|
|
|
@@ -1531,7 +1531,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
|
|
|
"CPACK_COMPONENT_" + cmsys::SystemTools::UpperCase(name);
|
|
|
component->Name = name;
|
|
|
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
|
|
|
- if (displayName && *displayName) {
|
|
|
+ if (cmNonempty(displayName)) {
|
|
|
component->DisplayName = displayName;
|
|
|
} else {
|
|
|
component->DisplayName = component->Name;
|
|
|
@@ -1543,17 +1543,17 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
|
|
|
cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
|
|
|
|
|
|
const char* archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
|
|
|
- if (archiveFile && *archiveFile) {
|
|
|
+ if (cmNonempty(archiveFile)) {
|
|
|
component->ArchiveFile = archiveFile;
|
|
|
}
|
|
|
|
|
|
const char* plist = this->GetOption(macroPrefix + "_PLIST");
|
|
|
- if (plist && *plist) {
|
|
|
+ if (cmNonempty(plist)) {
|
|
|
component->Plist = plist;
|
|
|
}
|
|
|
|
|
|
const char* groupName = this->GetOption(macroPrefix + "_GROUP");
|
|
|
- if (groupName && *groupName) {
|
|
|
+ if (cmNonempty(groupName)) {
|
|
|
component->Group = GetComponentGroup(projectName, groupName);
|
|
|
component->Group->Components.push_back(component);
|
|
|
} else {
|
|
|
@@ -1561,13 +1561,13 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
|
|
|
}
|
|
|
|
|
|
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
|
|
|
- if (description && *description) {
|
|
|
+ if (cmNonempty(description)) {
|
|
|
component->Description = description;
|
|
|
}
|
|
|
|
|
|
// Determine the installation types.
|
|
|
const char* installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
|
|
|
- if (installTypes && *installTypes) {
|
|
|
+ if (cmNonempty(installTypes)) {
|
|
|
std::vector<std::string> installTypesVector =
|
|
|
cmExpandedList(installTypes);
|
|
|
for (std::string const& installType : installTypesVector) {
|
|
|
@@ -1578,7 +1578,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
|
|
|
|
|
|
// Determine the component dependencies.
|
|
|
const char* depends = this->GetOption(macroPrefix + "_DEPENDS");
|
|
|
- if (depends && *depends) {
|
|
|
+ if (cmNonempty(depends)) {
|
|
|
std::vector<std::string> dependsVector = cmExpandedList(depends);
|
|
|
for (std::string const& depend : dependsVector) {
|
|
|
cmCPackComponent* child = GetComponent(projectName, depend);
|
|
|
@@ -1602,21 +1602,21 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
|
|
|
// Define the group
|
|
|
group->Name = name;
|
|
|
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
|
|
|
- if (displayName && *displayName) {
|
|
|
+ if (cmNonempty(displayName)) {
|
|
|
group->DisplayName = displayName;
|
|
|
} else {
|
|
|
group->DisplayName = group->Name;
|
|
|
}
|
|
|
|
|
|
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
|
|
|
- if (description && *description) {
|
|
|
+ if (cmNonempty(description)) {
|
|
|
group->Description = description;
|
|
|
}
|
|
|
group->IsBold = this->IsOn(macroPrefix + "_BOLD_TITLE");
|
|
|
group->IsExpandedByDefault = this->IsOn(macroPrefix + "_EXPANDED");
|
|
|
const char* parentGroupName =
|
|
|
this->GetOption(macroPrefix + "_PARENT_GROUP");
|
|
|
- if (parentGroupName && *parentGroupName) {
|
|
|
+ if (cmNonempty(parentGroupName)) {
|
|
|
group->ParentGroup = GetComponentGroup(projectName, parentGroupName);
|
|
|
group->ParentGroup->Subgroups.push_back(group);
|
|
|
} else {
|