summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2016-09-04 14:55:05 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2016-09-04 14:55:05 (GMT)
commit60dcaaea133931a323180c30eafabe4576e72cb8 (patch)
tree4f1e8855334fe41b9d98076a7c81c0963c0a526d /Source/CPack
parentfb357e5fef2e7803f2f745b6aa4cf63935628ed6 (diff)
downloadCMake-60dcaaea133931a323180c30eafabe4576e72cb8.zip
CMake-60dcaaea133931a323180c30eafabe4576e72cb8.tar.gz
CMake-60dcaaea133931a323180c30eafabe4576e72cb8.tar.bz2
tidy: Fix readability-redundant-string-cstr issues
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx5
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx11
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx9
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx16
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx10
5 files changed, 24 insertions, 27 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 640e437..14436da 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -330,8 +330,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
if (!cpack_dmg_disable_applications_symlink) {
std::ostringstream application_link;
application_link << staging.str() << "/Applications";
- cmSystemTools::CreateSymlink("/Applications",
- application_link.str().c_str());
+ cmSystemTools::CreateSymlink("/Applications", application_link.str());
}
// Optionally add a custom volume icon ...
@@ -755,7 +754,7 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to.
std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
- const char* _groupName = GetOption(groupVar.c_str());
+ const char* _groupName = GetOption(groupVar);
if (_groupName) {
std::string groupName = _groupName;
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index c0d2553..c36439f 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -102,15 +102,14 @@ int cmCPackOSXX11Generator::PackageFiles()
}
std::string applicationsLinkName = diskImageDirectory + "/Applications";
- cmSystemTools::CreateSymlink("/Applications", applicationsLinkName.c_str());
+ cmSystemTools::CreateSymlink("/Applications", applicationsLinkName);
- if (!this->CopyResourcePlistFile("VolumeIcon.icns",
- diskImageDirectory.c_str(),
+ if (!this->CopyResourcePlistFile("VolumeIcon.icns", diskImageDirectory,
".VolumeIcon.icns", true) ||
- !this->CopyResourcePlistFile("DS_Store", diskImageDirectory.c_str(),
- ".DS_Store", true) ||
+ !this->CopyResourcePlistFile("DS_Store", diskImageDirectory, ".DS_Store",
+ true) ||
!this->CopyResourcePlistFile("background.png",
- diskImageBackgroundImageDir.c_str(),
+ diskImageBackgroundImageDir,
"background.png", true) ||
!this->CopyResourcePlistFile("RuntimeScript", dir) ||
!this->CopyResourcePlistFile("OSXX11.Info.plist", contDir,
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index 19b587a..e5b96e3 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -225,8 +225,7 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
dirName += '/';
dirName += component.Name;
dirName += this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX");
- unsigned long installedSize =
- component.GetInstalledSizeInKbytes(dirName.c_str());
+ unsigned long installedSize = component.GetInstalledSizeInKbytes(dirName);
xout.StartElement("pkg-ref");
xout.Attribute("id", packageId);
@@ -283,7 +282,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
{
std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
- const char* inFileName = this->GetOption(cpackVar.c_str());
+ const char* inFileName = this->GetOption(cpackVar);
if (!inFileName) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: "
<< cpackVar.c_str()
@@ -314,7 +313,7 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(const std::string& name,
// Set this so that distribution.dist gets the right name (without
// the path).
- this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(),
+ this->SetOption("CPACK_RESOURCE_FILE_" + uname + "_NOPATH",
(name + ext).c_str());
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
@@ -358,7 +357,7 @@ int cmCPackPKGGenerator::CopyInstallScript(const std::string& resdir,
std::string dst = resdir;
dst += "/";
dst += name;
- cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str());
+ cmSystemTools::CopyFileAlways(script, dst);
cmSystemTools::SetPermissions(dst.c_str(), 0777);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"copy script : " << script << "\ninto " << dst << std::endl);
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index ce329ca..0704e9f 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -118,13 +118,13 @@ int cmCPackPackageMakerGenerator::PackageFiles()
// then copy them into the resource directory and make
// them executable
if (preflight) {
- this->CopyInstallScript(resDir.c_str(), preflight, "preflight");
+ this->CopyInstallScript(resDir, preflight, "preflight");
}
if (postflight) {
- this->CopyInstallScript(resDir.c_str(), postflight, "postflight");
+ this->CopyInstallScript(resDir, postflight, "postflight");
}
if (postupgrade) {
- this->CopyInstallScript(resDir.c_str(), postupgrade, "postupgrade");
+ this->CopyInstallScript(resDir, postupgrade, "postupgrade");
}
} else if (postflight) {
// create a postflight component to house the script
@@ -160,7 +160,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
// copy postflight script into resource directory of .pkg
std::string resourceDir = packageFile + "/Contents/Resources";
- this->CopyInstallScript(resourceDir.c_str(), postflight, "postflight");
+ this->CopyInstallScript(resourceDir, postflight, "postflight");
}
if (!this->Components.empty()) {
@@ -254,9 +254,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
this->SetOption("CPACK_MODULE_VERSION_SUFFIX", "");
// Copy or create all of the resource files we need.
- if (!this->CopyCreateResourceFile("License", resDir.c_str()) ||
- !this->CopyCreateResourceFile("ReadMe", resDir.c_str()) ||
- !this->CopyCreateResourceFile("Welcome", resDir.c_str()) ||
+ if (!this->CopyCreateResourceFile("License", resDir) ||
+ !this->CopyCreateResourceFile("ReadMe", resDir) ||
+ !this->CopyCreateResourceFile("Welcome", resDir) ||
!this->CopyResourcePlistFile("Info.plist") ||
!this->CopyResourcePlistFile("Description.plist")) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
@@ -372,7 +372,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
}
// Get path to the real PackageMaker, not a symlink:
- pkgPath = cmSystemTools::GetRealPath(pkgPath.c_str());
+ pkgPath = cmSystemTools::GetRealPath(pkgPath);
// Up from there to find the version.plist file in the "Contents" dir:
std::string contents_dir;
contents_dir = cmSystemTools::GetFilenamePath(pkgPath);
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index c2a13d0..d867046 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -73,9 +73,9 @@ int cmCPackProductBuildGenerator::PackageFiles()
// Copy or create all of the resource files we need.
std::string resDir = packageDirFileName + "/Contents";
- if (!this->CopyCreateResourceFile("License", resDir.c_str()) ||
- !this->CopyCreateResourceFile("ReadMe", resDir.c_str()) ||
- !this->CopyCreateResourceFile("Welcome", resDir.c_str())) {
+ if (!this->CopyCreateResourceFile("License", resDir) ||
+ !this->CopyCreateResourceFile("ReadMe", resDir) ||
+ !this->CopyCreateResourceFile("Welcome", resDir)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files"
<< std::endl);
return 0;
@@ -185,10 +185,10 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
// then copy them into the script directory and make
// them executable
if (preflight) {
- this->CopyInstallScript(scriptDir.c_str(), preflight, "preinstall");
+ this->CopyInstallScript(scriptDir, preflight, "preinstall");
}
if (postflight) {
- this->CopyInstallScript(scriptDir.c_str(), postflight, "postinstall");
+ this->CopyInstallScript(scriptDir, postflight, "postinstall");
}
// The command that will be used to run ProductBuild