summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-08-27 11:44:56 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-08-27 13:26:37 (GMT)
commit563ac22a1646f1287d1baac755e13cbe33c1fe7b (patch)
treed2f791c10703c3e89cc52ad5be566ec63fd9acc2 /Source
parent08be47cf939c3adfe653809c46c7b23b7a912a39 (diff)
downloadCMake-563ac22a1646f1287d1baac755e13cbe33c1fe7b.zip
CMake-563ac22a1646f1287d1baac755e13cbe33c1fe7b.tar.gz
CMake-563ac22a1646f1287d1baac755e13cbe33c1fe7b.tar.bz2
Convert: Replace trivial conversion with new method
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDependsC.cxx4
-rw-r--r--Source/cmDependsFortran.cxx10
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx4
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx6
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx21
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmListFileCache.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx10
-rw-r--r--Source/cmLocalNinjaGenerator.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx11
-rw-r--r--Source/cmMakefileTargetGenerator.cxx9
-rw-r--r--Source/cmTarget.cxx3
13 files changed, 57 insertions, 36 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 18e123e..928f7ec 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -238,8 +238,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// written by the original local generator for this directory
// convert the dependencies to paths relative to the home output
// directory. We must do the same here.
- std::string obj_i =
- this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT);
+ std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
+ obj, cmOutputConverter::HOME_OUTPUT);
std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
obj_i, cmOutputConverter::MAKERULE);
internalDepends << obj_i << std::endl;
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index c57b558..8c0acce 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -193,15 +193,15 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
stamp += ".mod.stamp";
fcStream << "\n";
fcStream << " \""
- << this->LocalGenerator->Convert(
+ << this->LocalGenerator->ConvertToRelativePath(
mod_lower, cmOutputConverter::START_OUTPUT)
<< "\"\n";
fcStream << " \""
- << this->LocalGenerator->Convert(
+ << this->LocalGenerator->ConvertToRelativePath(
mod_upper, cmOutputConverter::START_OUTPUT)
<< "\"\n";
fcStream << " \""
- << this->LocalGenerator->Convert(
+ << this->LocalGenerator->ConvertToRelativePath(
stamp, cmOutputConverter::START_OUTPUT)
<< "\"\n";
}
@@ -317,8 +317,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
const char* src = info.Source.c_str();
// Write the include dependencies to the output stream.
- std::string obj_i =
- this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT);
+ std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
+ obj, cmOutputConverter::HOME_OUTPUT);
std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
obj_i, cmOutputConverter::MAKERULE);
internalDepends << obj_i << std::endl;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index e617b08..945ee40 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -904,8 +904,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
it != this->GlobalGenerator->GetLocalGenerators().end(); ++it) {
const std::vector<cmGeneratorTarget*> targets =
(*it)->GetGeneratorTargets();
- std::string subdir = (*it)->Convert((*it)->GetCurrentBinaryDirectory(),
- cmOutputConverter::HOME_OUTPUT);
+ std::string subdir = (*it)->ConvertToRelativePath(
+ (*it)->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
if (subdir == ".") {
subdir = "";
}
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 295f65b..50c5a42 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2547,8 +2547,8 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
// Shorten the output name (in expected use case).
cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
- std::string fname =
- converter.Convert(outputs[0], cmOutputConverter::HOME_OUTPUT);
+ std::string fname = converter.ConvertToRelativePath(
+ outputs[0], cmOutputConverter::HOME_OUTPUT);
// Associate the hash with this output.
this->RuleHashes[fname] = hash;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2b83479..939c5ad 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -747,7 +747,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
{
cmLocalNinjaGenerator* ng =
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
- std::string convPath = ng->Convert(path, cmOutputConverter::HOME_OUTPUT);
+ std::string convPath =
+ ng->ConvertToRelativePath(path, cmOutputConverter::HOME_OUTPUT);
convPath = this->NinjaOutputPath(convPath);
#ifdef _WIN32
std::replace(convPath.begin(), convPath.end(), '/', '\\');
@@ -760,7 +761,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaFolderRule(
{
cmLocalNinjaGenerator* ng =
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
- std::string convPath = ng->Convert(path + "/all", cmOutputConverter::HOME);
+ std::string convPath =
+ ng->ConvertToRelativePath(path + "/all", cmOutputConverter::HOME);
convPath = this->NinjaOutputPath(convPath);
#ifdef _WIN32
std::replace(convPath.begin(), convPath.end(), '/', '\\');
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index f115ecb..bbc794d 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -311,11 +311,14 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream
<< "# The top level Makefile was generated from the following files:\n"
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
- << " \"" << lg->Convert(cache, cmOutputConverter::START_OUTPUT) << "\"\n";
+ << " \""
+ << lg->ConvertToRelativePath(cache, cmOutputConverter::START_OUTPUT)
+ << "\"\n";
for (std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i) {
cmakefileStream << " \""
- << lg->Convert(*i, cmOutputConverter::START_OUTPUT)
+ << lg->ConvertToRelativePath(
+ *i, cmOutputConverter::START_OUTPUT)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -329,10 +332,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream << "# The corresponding makefile is:\n"
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \""
- << lg->Convert(makefileName, cmOutputConverter::START_OUTPUT)
+ << lg->ConvertToRelativePath(makefileName,
+ cmOutputConverter::START_OUTPUT)
<< "\"\n"
<< " \""
- << lg->Convert(check, cmOutputConverter::START_OUTPUT)
+ << lg->ConvertToRelativePath(check,
+ cmOutputConverter::START_OUTPUT)
<< "\"\n";
cmakefileStream << " )\n\n";
@@ -345,7 +350,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
for (std::vector<std::string>::const_iterator k = outfiles.begin();
k != outfiles.end(); ++k) {
cmakefileStream << " \""
- << lg->Convert(*k, cmOutputConverter::HOME_OUTPUT)
+ << lg->ConvertToRelativePath(
+ *k, cmOutputConverter::HOME_OUTPUT)
<< "\"\n";
}
@@ -358,7 +364,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr += cmake::GetCMakeFilesDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake";
cmakefileStream << " \""
- << lg->Convert(tmpStr, cmOutputConverter::HOME_OUTPUT)
+ << lg->ConvertToRelativePath(
+ tmpStr, cmOutputConverter::HOME_OUTPUT)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -519,7 +526,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
tname += "/fast";
}
cmOutputConverter conv(mf->GetStateSnapshot());
- tname = conv.Convert(tname, cmOutputConverter::HOME_OUTPUT);
+ tname = conv.ConvertToRelativePath(tname, cmOutputConverter::HOME_OUTPUT);
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(tname);
if (this->Makefiles.empty()) {
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 0a83b3a..67ac230 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -385,7 +385,8 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if (vcprojName) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::string dir = lg->GetCurrentBinaryDirectory();
- dir = root->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT);
+ dir = root->ConvertToRelativePath(dir.c_str(),
+ cmOutputConverter::START_OUTPUT);
if (dir == ".") {
dir = ""; // msbuild cannot handle ".\" prefix
}
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 39d9e97..3c5e333 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -402,7 +402,8 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
cmOutputConverter converter(this->Bottom);
cmListFileContext lfc = *this->Cur;
if (!this->Bottom.GetState()->GetIsInTryCompile()) {
- lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+ lfc.FilePath =
+ converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
}
out << (lfc.Line ? " at " : " in ") << lfc;
}
@@ -427,7 +428,8 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
}
cmListFileContext lfc = *i;
if (!this->Bottom.GetState()->GetIsInTryCompile()) {
- lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+ lfc.FilePath =
+ converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
}
out << " " << lfc << "\n";
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 20a1e21..2fa3f86 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -176,7 +176,7 @@ void cmLocalGenerator::GenerateTestFiles()
// TODO: Use add_subdirectory instead?
fout << "subdirs(";
std::string outP = children[i].GetDirectory().GetCurrentBinary();
- fout << this->Convert(outP, START_OUTPUT);
+ fout << this->ConvertToRelativePath(outP, START_OUTPUT);
fout << ")" << std::endl;
}
}
@@ -2237,7 +2237,8 @@ std::string cmLocalGenerator::ConstructComment(
for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin();
o != ccg.GetOutputs().end(); ++o) {
comment += sep;
- comment += this->Convert(*o, cmOutputConverter::START_OUTPUT);
+ comment +=
+ this->ConvertToRelativePath(*o, cmOutputConverter::START_OUTPUT);
sep = ", ";
}
return comment;
@@ -2505,13 +2506,14 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
const char* fullPath = source.GetFullPath().c_str();
// Try referencing the source relative to the source tree.
- std::string relFromSource = this->Convert(fullPath, START);
+ std::string relFromSource = this->ConvertToRelativePath(fullPath, START);
assert(!relFromSource.empty());
bool relSource = !cmSystemTools::FileIsFullPath(relFromSource.c_str());
bool subSource = relSource && relFromSource[0] != '.';
// Try referencing the source relative to the binary tree.
- std::string relFromBinary = this->Convert(fullPath, START_OUTPUT);
+ std::string relFromBinary =
+ this->ConvertToRelativePath(fullPath, START_OUTPUT);
assert(!relFromBinary.empty());
bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary.c_str());
bool subBinary = relBinary && relFromBinary[0] != '.';
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 8c092e7..9e2c920 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -41,7 +41,7 @@ void cmLocalNinjaGenerator::Generate()
{
// Compute the path to use when referencing the current output
// directory from the top output directory.
- this->HomeRelativeOutputPath = this->Convert(
+ this->HomeRelativeOutputPath = this->ConvertToRelativePath(
this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath = "";
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 33b0102..5b83b3d 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -140,7 +140,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
{
// Compute the path to use when referencing the current output
// directory from the top output directory.
- this->HomeRelativeOutputPath = this->Convert(
+ this->HomeRelativeOutputPath = this->ConvertToRelativePath(
this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath = "";
@@ -966,7 +966,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
// working directory will be the start-output directory.
bool had_slash = cmd.find('/') != cmd.npos;
if (workingDir.empty()) {
- cmd = this->Convert(cmd, cmOutputConverter::START_OUTPUT);
+ cmd =
+ this->ConvertToRelativePath(cmd, cmOutputConverter::START_OUTPUT);
}
bool has_slash = cmd.find('/') != cmd.npos;
if (had_slash && !has_slash) {
@@ -1851,7 +1852,8 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
for (std::vector<std::string>::iterator i = includes.begin();
i != includes.end(); ++i) {
cmakefileStream << " \""
- << this->Convert(*i, cmOutputConverter::HOME_OUTPUT)
+ << this->ConvertToRelativePath(
+ *i, cmOutputConverter::HOME_OUTPUT)
<< "\"\n";
}
cmakefileStream << " )\n";
@@ -1915,7 +1917,8 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
// Add the target.
if (!tgt.empty()) {
// The make target is always relative to the top of the build tree.
- std::string tgt2 = this->Convert(tgt, cmOutputConverter::HOME_OUTPUT);
+ std::string tgt2 =
+ this->ConvertToRelativePath(tgt, cmOutputConverter::HOME_OUTPUT);
// The target may have been written with windows paths.
cmSystemTools::ConvertToOutputSlashes(tgt2);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2d53669..b34cd6e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -312,8 +312,10 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
output += "/";
output += cmSystemTools::GetFilenameName(input);
this->Generator->CleanFiles.push_back(
- this->Generator->Convert(output, cmOutputConverter::START_OUTPUT));
- output = this->Generator->Convert(output, cmOutputConverter::HOME_OUTPUT);
+ this->Generator->LocalGenerator->ConvertToRelativePath(
+ output, cmOutputConverter::START_OUTPUT));
+ output = this->Generator->LocalGenerator->ConvertToRelativePath(
+ output, cmOutputConverter::HOME_OUTPUT);
// Create a rule to copy the content into the bundle.
std::vector<std::string> depends;
@@ -1171,7 +1173,8 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
for (std::vector<std::string>::const_iterator i =
this->ExternalObjects.begin();
i != this->ExternalObjects.end(); ++i) {
- object = this->Convert(*i, cmOutputConverter::START_OUTPUT);
+ object = this->LocalGenerator->ConvertToRelativePath(
+ *i, cmOutputConverter::START_OUTPUT);
*this->BuildFileStream << " " << lineContinue << "\n"
<< this->Makefile->GetSafeDefinition(
"CMAKE_OBJECT_NAME");
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ed04d2f..d5274cd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -602,7 +602,8 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
it != this->TLLCommands.end(); ++it) {
if (it->first == sig) {
cmListFileContext lfc = it->second;
- lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+ lfc.FilePath =
+ converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
s << " * " << lfc << std::endl;
}
}