diff options
author | Brad King <brad.king@kitware.com> | 2002-12-13 21:16:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2002-12-13 21:16:48 (GMT) |
commit | 3348131819bb30a592898631df11aaf8ad8db4d2 (patch) | |
tree | bc84549b8fd511222dfe58aae3d4613b17a85a4d /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 7e824e83a9c97234f23640188c590201eeffea5d (diff) | |
download | CMake-3348131819bb30a592898631df11aaf8ad8db4d2.zip CMake-3348131819bb30a592898631df11aaf8ad8db4d2.tar.gz CMake-3348131819bb30a592898631df11aaf8ad8db4d2.tar.bz2 |
ENH: Added source file property OBJECT_DEPENDS to support generated header files included in non-generated sources.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 668c9d6..963199b 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -664,14 +664,35 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, std::string source = cc->first; const cmSourceGroup::Commands& commands = cc->second.m_Commands; const char* compileFlags = 0; + std::string additionalDeps; if(cc->second.m_SourceFile) { + // Check for extra compiler flags. compileFlags = cc->second.m_SourceFile->GetProperty("COMPILE_FLAGS"); + + // Check for extra object-file dependencies. + const char* deps = + cc->second.m_SourceFile->GetProperty("OBJECT_DEPENDS"); + if(deps) + { + std::vector<std::string> depends; + cmSystemTools::ExpandListArgument(deps, depends); + if(!depends.empty()) + { + std::vector<std::string>::iterator i = depends.begin(); + additionalDeps = this->ConvertToXMLOutputPath(i->c_str()); + for(++i;i != depends.end(); ++i) + { + additionalDeps += ";"; + additionalDeps += this->ConvertToXMLOutputPath(i->c_str()); + } + } + } } if (source != libName || target.GetType() == cmTarget::UTILITY) { fout << "\t\t\t<File\n"; - std::string d = cmSystemTools::ConvertToOutputPath(source.c_str()); + std::string d = this->ConvertToXMLOutputPath(source.c_str()); // remove double quotes from the string cmSystemTools::ReplaceString(d, "\"", ""); // Tell MS-Dev what the source is. If the compiler knows how to @@ -689,7 +710,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, totalCommand.m_Depends, totalCommand.m_Outputs, compileFlags); } - else if(compileFlags) + else if(compileFlags || additionalDeps.length()) { for(std::vector<std::string>::iterator i = configs->begin(); i != configs->end(); ++i) @@ -697,9 +718,18 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, fout << "\t\t\t\t<FileConfiguration\n" << "\t\t\t\t\tName=\"" << *i << "|Win32\">\n" << "\t\t\t\t\t<Tool\n" - << "\t\t\t\t\tName=\"VCCLCompilerTool\"\n" - << "\t\t\t\t\tAdditionalOptions=\"" - << compileFlags << "\"/>\n" + << "\t\t\t\t\tName=\"VCCLCompilerTool\"\n"; + if(compileFlags) + { + fout << "\t\t\t\t\tAdditionalOptions=\"" + << compileFlags << "\"\n"; + } + if(additionalDeps.length()) + { + fout << "\t\t\t\t\tAdditionalDependencies=\"" + << additionalDeps.c_str() << "\"\n"; + } + fout << "\t\t\t\t\t/>\n" << "\t\t\t\t</FileConfiguration>\n"; } } @@ -783,7 +813,7 @@ void cmLocalVisualStudio7Generator::WriteCustomRule(std::ostream& fout, { first = false; } - fout << output->c_str(); + fout << this->ConvertToXMLOutputPath(output->c_str()); } fout << "\"/>\n"; fout << "\t\t\t\t</FileConfiguration>\n"; |