summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-26 13:49:10 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-26 13:49:10 (GMT)
commit3498a8c66864dd5caddf770b8fe6ff24b2b61415 (patch)
tree808c3a37cdb8f1b7bdcac0943f2844730133027b /Source/cmLocalGenerator.cxx
parent338d37ee5af1cf3ba50290edc80ea72542d1cd12 (diff)
downloadCMake-3498a8c66864dd5caddf770b8fe6ff24b2b61415.zip
CMake-3498a8c66864dd5caddf770b8fe6ff24b2b61415.tar.gz
CMake-3498a8c66864dd5caddf770b8fe6ff24b2b61415.tar.bz2
ENH: Simplify reverse cmLocalGenerator::Convert
It does not make sense to call the reverse Convert signature (for remote paths corresponding to CMake-managed directories) with NONE or FULL since they have no path. Patch from Modestas Vainius. See issue #7779.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx22
1 files changed, 6 insertions, 16 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 70e5760..a6bc6ad 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2200,25 +2200,15 @@ std::string cmLocalGenerator::Convert(RelativeRoot remote,
bool optional)
{
const char* remotePath = this->GetRelativeRootPath(remote);
+
+ // The relative root must have a path (i.e. not FULL or NONE)
+ assert(remotePath != 0);
+
if(local && (!optional || this->UseRelativePaths))
{
std::vector<std::string> components;
- std::string result;
- switch(remote)
- {
- case HOME:
- case HOME_OUTPUT:
- case START:
- case START_OUTPUT:
- cmSystemTools::SplitPath(local, components);
- result = this->ConvertToRelativePath(components, remotePath);
- break;
- case FULL:
- result = remotePath;
- break;
- case NONE:
- break;
- }
+ cmSystemTools::SplitPath(local, components);
+ std::string result = this->ConvertToRelativePath(components, remotePath);
return this->ConvertToOutputFormat(result.c_str(), output);
}
else