summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-09-06 21:02:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-09-19 19:36:13 (GMT)
commit34c6e995f9ac1c62540b68dd50934c8c0be98b7f (patch)
treed68b3f9c23b61a112f41cf3f6a8f2338f5cf03cb
parent839c65bca032b80cfa7fe0de2ad35c2448421092 (diff)
downloadCMake-34c6e995f9ac1c62540b68dd50934c8c0be98b7f.zip
CMake-34c6e995f9ac1c62540b68dd50934c8c0be98b7f.tar.gz
CMake-34c6e995f9ac1c62540b68dd50934c8c0be98b7f.tar.bz2
Convert: Avoid HOME_OUTPUT enum when converting to relative paths
-rw-r--r--Source/cmDependsC.cxx2
-rw-r--r--Source/cmDependsFortran.cxx2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx11
-rw-r--r--Source/cmLocalNinjaGenerator.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Source/cmMakefileTargetGenerator.cxx4
9 files changed, 18 insertions, 17 deletions
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index fbbf42f..bc71aac 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -240,7 +240,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// convert the dependencies to paths relative to the home output
// directory. We must do the same here.
std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
- obj, cmOutputConverter::HOME_OUTPUT);
+ this->LocalGenerator->GetBinaryDirectory(), obj);
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 44592bb..925e385 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -332,7 +332,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
// Write the include dependencies to the output stream.
std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
- obj, cmOutputConverter::HOME_OUTPUT);
+ this->LocalGenerator->GetBinaryDirectory(), obj);
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 5a98e34..d1be0c7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -914,7 +914,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
const std::vector<cmGeneratorTarget*> targets =
(*it)->GetGeneratorTargets();
std::string subdir = (*it)->ConvertToRelativePath(
- (*it)->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
+ (*it)->GetBinaryDirectory(), (*it)->GetCurrentBinaryDirectory());
if (subdir == ".") {
subdir = "";
}
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ed73450..4772474 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2579,7 +2579,7 @@ 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.ConvertToRelativePath(
- outputs[0], cmOutputConverter::HOME_OUTPUT);
+ this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
// Associate the hash with this output.
this->RuleHashes[fname] = hash;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 7e343c9..bd65366 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -760,8 +760,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
{
cmLocalNinjaGenerator* ng =
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
- std::string convPath =
- ng->ConvertToRelativePath(path, cmOutputConverter::HOME_OUTPUT);
+ std::string convPath = ng->ConvertToRelativePath(
+ this->LocalGenerators[0]->GetState()->GetBinaryDirectory(), path);
convPath = this->NinjaOutputPath(convPath);
#ifdef _WIN32
std::replace(convPath.begin(), convPath.end(), '/', '\\');
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index caf71fd..5438375 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -356,8 +356,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
for (std::vector<std::string>::const_iterator k = outfiles.begin();
k != outfiles.end(); ++k) {
cmakefileStream << " \""
- << lg->ConvertToRelativePath(
- *k, cmOutputConverter::HOME_OUTPUT)
+ << lg->ConvertToRelativePath(lg->GetBinaryDirectory(),
+ *k)
<< "\"\n";
}
@@ -370,8 +370,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr += cmake::GetCMakeFilesDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake";
cmakefileStream << " \""
- << lg->ConvertToRelativePath(
- tmpStr, cmOutputConverter::HOME_OUTPUT)
+ << lg->ConvertToRelativePath(lg->GetBinaryDirectory(),
+ tmpStr)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -532,7 +532,8 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
tname += "/fast";
}
cmOutputConverter conv(mf->GetStateSnapshot());
- tname = conv.ConvertToRelativePath(tname, cmOutputConverter::HOME_OUTPUT);
+ tname =
+ conv.ConvertToRelativePath(mf->GetState()->GetBinaryDirectory(), tname);
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(tname);
if (this->Makefiles.empty()) {
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 6793f84..f651c6e 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -51,7 +51,7 @@ void cmLocalNinjaGenerator::Generate()
// Compute the path to use when referencing the current output
// directory from the top output directory.
this->HomeRelativeOutputPath = this->ConvertToRelativePath(
- this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
+ this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath = "";
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 9d3567e..6d2dac2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -151,7 +151,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
// Compute the path to use when referencing the current output
// directory from the top output directory.
this->HomeRelativeOutputPath = this->ConvertToRelativePath(
- this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
+ this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath = "";
}
@@ -1865,7 +1865,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
i != includes.end(); ++i) {
cmakefileStream << " \""
<< this->ConvertToRelativePath(
- *i, cmOutputConverter::HOME_OUTPUT)
+ this->GetBinaryDirectory(), *i)
<< "\"\n";
}
cmakefileStream << " )\n";
@@ -1930,7 +1930,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
if (!tgt.empty()) {
// The make target is always relative to the top of the build tree.
std::string tgt2 =
- this->ConvertToRelativePath(tgt, cmOutputConverter::HOME_OUTPUT);
+ this->ConvertToRelativePath(this->GetBinaryDirectory(), tgt);
// The target may have been written with windows paths.
cmSystemTools::ConvertToOutputSlashes(tgt2);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index df06dc1..fc5af4a 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -317,7 +317,7 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
this->Generator->LocalGenerator->ConvertToRelativePath(
this->Generator->LocalGenerator->GetCurrentBinaryDirectory(), output));
output = this->Generator->LocalGenerator->ConvertToRelativePath(
- output, cmOutputConverter::HOME_OUTPUT);
+ this->Generator->LocalGenerator->GetBinaryDirectory(), output);
// Create a rule to copy the content into the bundle.
std::vector<std::string> depends;
@@ -1275,7 +1275,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
std::string buildTargetRuleName = dir;
buildTargetRuleName += relink ? "/preinstall" : "/build";
buildTargetRuleName = this->LocalGenerator->ConvertToRelativePath(
- buildTargetRuleName, cmOutputConverter::HOME_OUTPUT);
+ this->LocalGenerator->GetBinaryDirectory(), buildTargetRuleName);
// Build the list of target outputs to drive.
std::vector<std::string> depends;