summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-07-11 17:23:02 (GMT)
committerBrad King <brad.king@kitware.com>2006-07-11 17:23:02 (GMT)
commit87ef95c71549a7aada8be6ed5d7f45f0aefc85ce (patch)
treef66b08d39d0942d7813e92dd0f843a45870fc468 /Source/cmLocalVisualStudio6Generator.cxx
parent9bf5af6e32570195b06df594c1cb07f8c7a6a83e (diff)
downloadCMake-87ef95c71549a7aada8be6ed5d7f45f0aefc85ce.zip
CMake-87ef95c71549a7aada8be6ed5d7f45f0aefc85ce.tar.gz
CMake-87ef95c71549a7aada8be6ed5d7f45f0aefc85ce.tar.bz2
ENH: Made cmLocalVisualStudioGenerator a superclass of cmLocalVisualStudio6Generator. Implemented object file unique naming when multiple sources share the same name.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index a12d0e7..54bdafe 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -359,6 +359,9 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
}
}
}
+
+ // Compute which sources need unique object computation.
+ this->ComputeObjectNameRequirements(sourceGroups);
// Write the DSP file's header.
this->WriteDSPHeader(fout, libName, target, sourceGroups);
@@ -404,6 +407,13 @@ void cmLocalVisualStudio6Generator
(*sf)->GetCustomCommand();
std::string compileFlags;
std::vector<std::string> depends;
+ std::string objectNameDir;
+ if(this->NeedObjectName.find(*sf) != this->NeedObjectName.end())
+ {
+ objectNameDir =
+ cmSystemTools::GetFilenamePath(
+ this->GetObjectFileNameWithoutTarget(*(*sf)));
+ }
// Add per-source file flags.
if(const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"))
@@ -464,7 +474,7 @@ void cmLocalVisualStudio6Generator
comment.c_str(), command->GetDepends(),
command->GetOutputs(), flags);
}
- else if(compileFlags.size())
+ else if(!compileFlags.empty() || !objectNameDir.empty())
{
for(std::vector<std::string>::iterator i
= this->Configurations.begin();
@@ -478,7 +488,22 @@ void cmLocalVisualStudio6Generator
{
fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl;
}
- fout << "\n# ADD CPP " << compileFlags << "\n\n";
+ if(!compileFlags.empty())
+ {
+ fout << "\n# ADD CPP " << compileFlags << "\n\n";
+ }
+ 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);
+
+ // Setup an alternate object file directory.
+ fout << "\n# PROP Intermediate_Dir \""
+ << config << "/" << objectNameDir << "\"\n\n";
+ }
}
fout << "!ENDIF\n\n";
}