diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 6a1df06aa..5f0586dbb 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -247,16 +247,23 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, // Write the DSP file's header. this->WriteDSPHeader(fout, libName, target, sourceGroups); + // if we should add regen rule then... + const char *suppRegenRule = + m_Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION"); + // Find the group in which the CMakeLists.txt source belongs, and add // the rule to generate this DSP file. - for(std::vector::reverse_iterator sg = sourceGroups.rbegin(); - sg != sourceGroups.rend(); ++sg) + if (!cmSystemTools::IsOn(suppRegenRule)) { - if(sg->Matches("CMakeLists.txt")) + for(std::vector::reverse_iterator sg = sourceGroups.rbegin(); + sg != sourceGroups.rend(); ++sg) { - this->AddDSPBuildRule(*sg); - break; - } + if(sg->Matches("CMakeLists.txt")) + { + this->AddDSPBuildRule(*sg); + break; + } + } } // Loop through every source group. diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 87e8e63a6..69064ff47 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -656,18 +656,26 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout, this->WriteConfigurations(fout, libName, target); fout << "\t\n"; + + // if we should add regen rule then... + const char *suppRegenRule = + m_Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION"); + // Find the group in which the CMakeLists.txt source belongs, and add // the rule to generate this VCProj file. - for(std::vector::reverse_iterator sg = sourceGroups.rbegin(); - sg != sourceGroups.rend(); ++sg) + if (!cmSystemTools::IsOn(suppRegenRule)) { - if(sg->Matches("CMakeLists.txt")) + for(std::vector::reverse_iterator sg = + sourceGroups.rbegin(); + sg != sourceGroups.rend(); ++sg) { - this->AddVCProjBuildRule(*sg); - break; - } + if(sg->Matches("CMakeLists.txt")) + { + this->AddVCProjBuildRule(*sg); + break; + } + } } - // Loop through every source group. for(std::vector::const_iterator sg = sourceGroups.begin();