summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-28 17:49:01 (GMT)
committerBrad King <brad.king@kitware.com>2012-03-28 18:07:51 (GMT)
commit01e979acef392776bd1ea1fb38126957746954e7 (patch)
tree5fa9d2f6ec1424b234f6111c49a7bd70fce05096 /Source/cmLocalVisualStudio6Generator.cxx
parent9a2c60eb836ae26a2cd47f3c21a810047b695db9 (diff)
downloadCMake-01e979acef392776bd1ea1fb38126957746954e7.zip
CMake-01e979acef392776bd1ea1fb38126957746954e7.tar.gz
CMake-01e979acef392776bd1ea1fb38126957746954e7.tar.bz2
VS: Add CMakeLists.txt re-run rules at start of generation
Since commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source classification, 2012-03-19) the VS 10 generator uses the cmGeneratorTarget source classification instead of directly getting the list of source files from the target. This accidentally dropped the CMakeLists.txt files from generated projects because they are added too late for cmGeneratorTarget. All generator-specific source files must be added to targets prior to cmGeneratorTarget construction. Refactor addition of the CMakeLists.txt files with CMake re-run custom commands to take place before normal generation begins, and therefore early enough to be included in the cmGeneratorTarget classification.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx29
1 files changed, 17 insertions, 12 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 5b99dfd..99a4c95 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -85,6 +85,23 @@ void cmLocalVisualStudio6Generator::AddHelperCommands()
this->CreateCustomTargetsAndCommands(lang);
}
+void cmLocalVisualStudio6Generator::AddCMakeListsRules()
+{
+ cmTargets &tgts = this->Makefile->GetTargets();
+ for(cmTargets::iterator l = tgts.begin();
+ l != tgts.end(); l++)
+ {
+ // Add a rule to regenerate the build system when the target
+ // specification source changes.
+ const char* suppRegenRule =
+ this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION");
+ if (!cmSystemTools::IsOn(suppRegenRule))
+ {
+ this->AddDSPBuildRule(l->second);
+ }
+ }
+}
+
void cmLocalVisualStudio6Generator::Generate()
{
this->OutputDSPFile();
@@ -107,18 +124,6 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
// Create the DSP or set of DSP's for libraries and executables
cmTargets &tgts = this->Makefile->GetTargets();
- for(cmTargets::iterator l = tgts.begin();
- l != tgts.end(); l++)
- {
- // Add a rule to regenerate the build system when the target
- // specification source changes.
- const char* suppRegenRule =
- this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION");
- if (!cmSystemTools::IsOn(suppRegenRule))
- {
- this->AddDSPBuildRule(l->second);
- }
- }
// build any targets
for(cmTargets::iterator l = tgts.begin();