diff options
author | Brad King <brad.king@kitware.com> | 2012-03-28 17:49:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-03-28 18:07:51 (GMT) |
commit | 01e979acef392776bd1ea1fb38126957746954e7 (patch) | |
tree | 5fa9d2f6ec1424b234f6111c49a7bd70fce05096 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 9a2c60eb836ae26a2cd47f3c21a810047b695db9 (diff) | |
download | CMake-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/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 363d370..9faf46d 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -100,6 +100,28 @@ void cmLocalVisualStudio7Generator::Generate() this->WriteStampFiles(); } +void cmLocalVisualStudio7Generator::AddCMakeListsRules() +{ + cmTargets &tgts = this->Makefile->GetTargets(); + // Create the regeneration custom rule. + if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION")) + { + // Create a rule to regenerate the build system when the target + // specification source changes. + if(cmSourceFile* sf = this->CreateVCProjBuildRule()) + { + // Add the rule to targets that need it. + for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) + { + l->second.AddSourceFile(sf); + } + } + } + } +} + void cmLocalVisualStudio7Generator::FixGlobalTargets() { // Visual Studio .NET 2003 Service Pack 1 will not run post-build @@ -156,24 +178,6 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() // Get the set of targets in this directory. cmTargets &tgts = this->Makefile->GetTargets(); - // Create the regeneration custom rule. - if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION")) - { - // Create a rule to regenerate the build system when the target - // specification source changes. - if(cmSourceFile* sf = this->CreateVCProjBuildRule()) - { - // Add the rule to targets that need it. - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) - { - if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) - { - l->second.AddSourceFile(sf); - } - } - } - } - // Create the project file for each target. for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) |