From f76d01d56a48e1a00ea491681d219d547d3a7a94 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Mon, 16 Jun 2003 10:20:48 -0400 Subject: [PATCH] fix for vs6 rule files --- Source/cmLocalVisualStudio6Generator.cxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 055ac3aad9..23eb7a67a2 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -315,6 +315,8 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, srcFilesToProcess.pop(); } + // now all of the source files have been properly assigned to the target + // now stick them into source groups using the reg expressions for(std::vector::iterator i = classes.begin(); i != classes.end(); i++) { @@ -323,6 +325,27 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, cmSourceGroup& sourceGroup = m_Makefile->FindSourceGroup(source.c_str(), sourceGroups); sourceGroup.AddSource(source.c_str(), *i); + // while we are at it, if it is a .rule file then for visual studio 6 we + // must generate it + if ((*i)->GetSourceExtension() == "rule") + { + if(!cmSystemTools::FileExists(source.c_str())) + { +#if defined(_WIN32) || defined(__CYGWIN__) + std::ofstream fout(source.c_str(), + std::ios::binary | std::ios::out | std::ios::trunc); +#else + std::ofstream fout(source.c_str(), + std::ios::out | std::ios::trunc); +#endif + if(fout) + { + fout.write("# generated from CMake",22); + fout.flush(); + fout.close(); + } + } + } } // Write the DSP file's header.