diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-17 17:58:28 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-04-17 17:58:28 (GMT) |
commit | 69488e5bd22a59cc7bf0f571f0c9aec9a1273c39 (patch) | |
tree | c81dc4eae58a94024b93057bee8733cb5097e13e | |
parent | c80faed7f690a48e995b09a46e3185d4de6bc720 (diff) | |
download | CMake-69488e5bd22a59cc7bf0f571f0c9aec9a1273c39.zip CMake-69488e5bd22a59cc7bf0f571f0c9aec9a1273c39.tar.gz CMake-69488e5bd22a59cc7bf0f571f0c9aec9a1273c39.tar.bz2 |
ENH: allow multiple files with the same name in different subdirs
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index dd47fa2..1f40847 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -973,7 +973,8 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, this->WriteVCProjFooter(fout); } -void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget target, std::ostream &fout, const char *libName, std::vector<std::string> *configs) +void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget target, + std::ostream &fout, const char *libName, std::vector<std::string> *configs) { const std::vector<const cmSourceFile *> &sourceFiles = sg->GetSourceFiles(); @@ -991,6 +992,7 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget } // Loop through each source in the source group. + std::string sourceName; for(std::vector<const cmSourceFile *>::const_iterator sf = sourceFiles.begin(); sf != sourceFiles.end(); ++sf) { @@ -998,6 +1000,16 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget const cmCustomCommand *command = (*sf)->GetCustomCommand(); std::string compileFlags; std::string additionalDeps; + sourceName = (*sf)->GetSourceName(); + if(sourceName.find("/") != sourceName.npos) + { + cmSystemTools::ReplaceString(sourceName, "/", "_"); + sourceName += ".obj"; + } + else + { + sourceName = ""; + } // Add per-source flags. const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"); @@ -1049,7 +1061,7 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget comment.c_str(), command->GetDepends(), command->GetOutputs(), flags); } - else if(compileFlags.size() || additionalDeps.length()) + else if(compileFlags.size() || additionalDeps.length() || sourceName.size()) { const char* aCompilerTool = "VCCLCompilerTool"; std::string ext = (*sf)->GetSourceExtension(); @@ -1083,6 +1095,11 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget fout << "\t\t\t\t\tAdditionalDependencies=\"" << additionalDeps.c_str() << "\"\n"; } + if(sourceName.size()) + { + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" + << sourceName.c_str() << "\"\n"; + } fout << "\t\t\t\t\t/>\n" << "\t\t\t\t</FileConfiguration>\n"; } |