summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackGenerator.cxx14
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx12
-rw-r--r--Source/CPack/cpack.cxx2
4 files changed, 13 insertions, 18 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 893b2fc..9ff547a 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -239,8 +239,7 @@ int cmCPackArchiveGenerator::PackageFiles()
cmWorkingDirectory workdir(toplevel);
for (std::string const& file : files) {
// Get the relative path to the file
- std::string rp =
- cmSystemTools::RelativePath(toplevel.c_str(), file.c_str());
+ std::string rp = cmSystemTools::RelativePath(toplevel, file);
archive.Add(rp, 0, nullptr, false);
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< "
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 54a2a27..d838b30 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -187,7 +187,7 @@ int cmCPackGenerator::InstallProject()
const char* tempInstallDirectory = tempInstallDirectoryStr.c_str();
int res = 1;
- if (!cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory.c_str())) {
+ if (!cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating temporary directory: "
<< (tempInstallDirectory ? tempInstallDirectory : "(NULL)")
@@ -374,15 +374,14 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
continue;
}
std::string filePath = tempDir;
- filePath += "/" + subdir + "/" +
- cmSystemTools::RelativePath(top.c_str(), gf.c_str());
+ filePath += "/" + subdir + "/" + cmSystemTools::RelativePath(top, gf);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile << " -> " << filePath << std::endl);
/* If the file is a symlink we will have to re-create it */
if (cmSystemTools::FileIsSymlink(inFile)) {
std::string targetFile;
std::string inFileRelative =
- cmSystemTools::RelativePath(top.c_str(), inFile.c_str());
+ cmSystemTools::RelativePath(top, inFile);
cmSystemTools::ReadSymlink(inFile, targetFile);
symlinkedFiles.emplace_back(std::move(targetFile),
std::move(inFileRelative));
@@ -772,9 +771,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
}
// Remember the list of files before installation
// of the current component (if we are in component install)
- const char* InstallPrefix = tempInstallDirectory.c_str();
+ std::string const& InstallPrefix = tempInstallDirectory;
std::vector<std::string> filesBefore;
- std::string findExpr(InstallPrefix);
+ std::string findExpr = tempInstallDirectory;
if (componentInstall) {
cmsys::Glob glB;
findExpr += "/*";
@@ -829,8 +828,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string localFileName;
// Populate the File field of each component
for (fit = result.begin(); fit != diff; ++fit) {
- localFileName =
- cmSystemTools::RelativePath(InstallPrefix, fit->c_str());
+ localFileName = cmSystemTools::RelativePath(InstallPrefix, *fit);
localFileName =
localFileName.substr(localFileName.find_first_not_of('/'));
Components[installComponent].Files.push_back(localFileName);
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index ef2add3..3f7164a 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -62,8 +62,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::ostringstream str;
for (std::string const& file : files) {
std::string outputDir = "$INSTDIR";
- std::string fileN =
- cmSystemTools::RelativePath(toplevel.c_str(), file.c_str());
+ std::string fileN = cmSystemTools::RelativePath(toplevel, file);
if (!this->Components.empty()) {
const std::string::size_type pos = fileN.find('/');
@@ -90,8 +89,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::ostringstream dstr;
for (std::string const& dir : dirs) {
std::string componentName;
- std::string fileN =
- cmSystemTools::RelativePath(toplevel.c_str(), dir.c_str());
+ std::string fileN = cmSystemTools::RelativePath(toplevel, dir);
if (fileN.empty()) {
continue;
}
@@ -669,8 +667,8 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
uploadDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
uploadDirectory += "/CPackUploads";
}
- if (!cmSystemTools::FileExists(uploadDirectory.c_str())) {
- if (!cmSystemTools::MakeDirectory(uploadDirectory.c_str())) {
+ if (!cmSystemTools::FileExists(uploadDirectory)) {
+ if (!cmSystemTools::MakeDirectory(uploadDirectory)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Unable to create NSIS upload directory "
<< uploadDirectory << std::endl);
@@ -683,7 +681,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Building downloaded component archive: " << archiveFile
<< std::endl);
- if (cmSystemTools::FileExists(archiveFile.c_str(), true)) {
+ if (cmSystemTools::FileExists(archiveFile, true)) {
if (!cmSystemTools::RemoveFile(archiveFile)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to remove archive file "
<< archiveFile << std::endl);
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 7d47798..507a10c 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -260,7 +260,7 @@ int main(int argc, char const* const* argv)
globalMF.AddDefinition("CPACK_BUILD_CONFIG", cpackBuildConfig.c_str());
}
- if (cmSystemTools::FileExists(cpackConfigFile.c_str())) {
+ if (cmSystemTools::FileExists(cpackConfigFile)) {
cpackConfigFile = cmSystemTools::CollapseFullPath(cpackConfigFile);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile