diff options
author | Brad King <brad.king@kitware.com> | 2008-12-16 14:14:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-12-16 14:14:40 (GMT) |
commit | 3cf9265fa7d1f6c7753ae5f19947409e4d9b8e9c (patch) | |
tree | 3fc931ad8e1d7e26aa00a41009e35cb53538bb12 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 63e186a8e69e0283d4fa0499ee8679ebdd844e1d (diff) | |
download | CMake-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/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 2093099..2c92579 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1226,7 +1226,7 @@ public: cmTarget& target, cmSourceFile const& sf, std::vector<std::string>* configs, - std::string::size_type dir_len); + std::string const& dir_max); std::map<cmStdString, cmLVS7GFileConfig> FileConfigMap; }; @@ -1235,12 +1235,12 @@ cmLocalVisualStudio7GeneratorFCInfo cmTarget& target, cmSourceFile const& sf, std::vector<std::string>* configs, - std::string::size_type dir_len) + std::string const& dir_max) { std::string objectName; if(lg->NeedObjectName.find(&sf) != lg->NeedObjectName.end()) { - objectName = lg->GetObjectFileNameWithoutTarget(sf, dir_len); + objectName = lg->GetObjectFileNameWithoutTarget(sf, dir_max); } // Compute per-source, per-config information. @@ -1358,27 +1358,27 @@ void cmLocalVisualStudio7Generator this->WriteVCProjBeginGroup(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 = configs->begin(); i != configs->end(); ++i) { - if(i->size() > config_len_max) + if(i->size() > config_max.size()) { - config_len_max = i->size(); + config_max = *i; } } - // 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 += this->GetTargetDirectory(target).size(); - dir_len += 1; - dir_len += config_len_max; - dir_len += 1; + std::string dir_max; + dir_max += this->Makefile->GetCurrentOutputDirectory(); + dir_max += "/"; + dir_max += this->GetTargetDirectory(target); + dir_max += "/"; + dir_max += config_max; + dir_max += "/"; // Loop through each source in the source group. std::string objectName; @@ -1386,7 +1386,7 @@ void cmLocalVisualStudio7Generator sourceFiles.begin(); sf != sourceFiles.end(); ++sf) { std::string source = (*sf)->GetFullPath(); - FCInfo fcinfo(this, target, *(*sf), configs, dir_len); + FCInfo fcinfo(this, target, *(*sf), configs, dir_max); if (source != libName || target.GetType() == cmTarget::UTILITY || target.GetType() == cmTarget::GLOBAL_TARGET ) |