summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-12-16 14:14:40 (GMT)
committerBrad King <brad.king@kitware.com>2008-12-16 14:14:40 (GMT)
commit3cf9265fa7d1f6c7753ae5f19947409e4d9b8e9c (patch)
tree3fc931ad8e1d7e26aa00a41009e35cb53538bb12 /Source/cmLocalVisualStudio6Generator.cxx
parent63e186a8e69e0283d4fa0499ee8679ebdd844e1d (diff)
downloadCMake-3cf9265fa7d1f6c7753ae5f19947409e4d9b8e9c.zip
CMake-3cf9265fa7d1f6c7753ae5f19947409e4d9b8e9c.tar.gz
CMake-3cf9265fa7d1f6c7753ae5f19947409e4d9b8e9c.tar.bz2
ENH: Refactor passing of max length object dir
When computing the maximum length full path to the build directory under which object files will be placed, pass the actual path instead of just its length. This will be useful for error message generation.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index c00cdea..3493719 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -372,27 +372,27 @@ void cmLocalVisualStudio6Generator
this->WriteDSPBeginGroup(fout, name.c_str(), "");
}
- // Compute the maximum length of a configuration name.
- std::string::size_type config_len_max = 0;
+ // Compute the maximum length configuration name.
+ std::string config_max;
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
// Strip the subdirectory name out of the configuration name.
std::string config = this->GetConfigName(*i);
- if(config.size() > config_len_max)
+ if(config.size() > config_max.size())
{
- config_len_max = config.size();
+ config_max = config;
}
}
- // Compute the maximum length of the full path to the intermediate
+ // Compute the maximum length full path to the intermediate
// files directory for any configuration. This is used to construct
// object file names that do not produce paths that are too long.
- std::string::size_type dir_len = 0;
- dir_len += strlen(this->Makefile->GetCurrentOutputDirectory());
- dir_len += 1;
- dir_len += config_len_max;
- dir_len += 1;
+ std::string dir_max;
+ dir_max += this->Makefile->GetCurrentOutputDirectory();
+ dir_max += "/";
+ dir_max += config_max;
+ dir_max += "/";
// Loop through each source in the source group.
for(std::vector<const cmSourceFile *>::const_iterator sf =
@@ -408,7 +408,7 @@ void cmLocalVisualStudio6Generator
{
objectNameDir =
cmSystemTools::GetFilenamePath(
- this->GetObjectFileNameWithoutTarget(*(*sf), dir_len));
+ this->GetObjectFileNameWithoutTarget(*(*sf), dir_max));
}
// Add per-source file flags.