From c6092b7e5e9a421d317969eb3230ccdb7acc0065 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Aug 2007 13:02:59 -0400 Subject: [PATCH] BUG: Fixed passing of configuration names to GetRealDependency and ConstructScript. Added GetConfigName helper method to do this. --- Source/cmLocalVisualStudio6Generator.cxx | 29 +++++++++++++++--------- Source/cmLocalVisualStudio6Generator.h | 2 ++ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 0a48d83a1..a6fec829e 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -390,10 +390,7 @@ void cmLocalVisualStudio6Generator i != this->Configurations.end(); ++i) { // Strip the subdirectory name out of the configuration name. - std::string config = *i; - std::string::size_type pos = config.find_last_of(" "); - config = config.substr(pos+1, std::string::npos); - config = config.substr(0, config.size()-1); + std::string config = this->GetConfigName(*i); if(config.size() > config_len_max) { config_len_max = config.size(); @@ -500,10 +497,7 @@ void cmLocalVisualStudio6Generator if(!objectNameDir.empty()) { // Strip the subdirectory name out of the configuration name. - std::string config = *i; - std::string::size_type pos = config.find_last_of(" "); - config = config.substr(pos+1, std::string::npos); - config = config.substr(0, config.size()-1); + std::string config = this->GetConfigName(*i); // Setup an alternate object file directory. fout << "\n# PROP Intermediate_Dir \"" @@ -588,11 +582,11 @@ cmLocalVisualStudio6Generator std::vector::iterator i; for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - + std::string config = this->GetConfigName(*i); std::string script = this->ConstructScript(command.GetCommandLines(), command.GetWorkingDirectory(), - i->c_str(), + config.c_str(), command.GetEscapeOldStyle(), command.GetEscapeAllowMakeVars(), "\\\n\t"); @@ -617,7 +611,8 @@ cmLocalVisualStudio6Generator ++d) { // Lookup the real name of the dependency in case it is a CMake target. - std::string dep = this->GetRealDependency(d->c_str(), i->c_str()); + std::string dep = this->GetRealDependency(d->c_str(), + config.c_str()); fout << "\\\n\t" << this->ConvertToOptionallyRelativeOutputPath(dep.c_str()); } @@ -1585,3 +1580,15 @@ void cmLocalVisualStudio6Generator dir += this->GetGlobalGenerator()->GetCMakeCFGInitDirectory(); dirs.push_back(dir); } + +std::string +cmLocalVisualStudio6Generator +::GetConfigName(std::string const& configuration) const +{ + // Strip the subdirectory name out of the configuration name. + std::string config = configuration; + std::string::size_type pos = config.find_last_of(" "); + config = config.substr(pos+1, std::string::npos); + config = config.substr(0, config.size()-1); + return config; +} diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index d97a8db77..85dea08f6 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -101,6 +101,8 @@ private: std::string& options); std::string IncludeOptions; std::vector Configurations; + + std::string GetConfigName(std::string const& configuration) const; }; #endif