diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index fb475c3bd..3b905c03e 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -160,30 +160,9 @@ cmLocalGenerator *cmGlobalVisualStudio6Generator::CreateLocalGenerator() void cmGlobalVisualStudio6Generator::Generate() { - // add a special target that depends on ALL projects for easy build - // of one configuration only. - std::vector no_depends; - const char* no_working_dir = 0; - std::map >::iterator it; - for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) - { - std::vector& gen = it->second; - // add the ALL_BUILD to the first local generator of each project - if(gen.size()) - { - gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", true, - no_depends, - no_working_dir, - "echo", "Build all projects"); - } - } - - // Fix utility dependencies to avoid linking to libraries. - this->FixUtilityDepends(); - // first do the superclass method - this->cmGlobalGenerator::Generate(); - + this->cmGlobalVisualStudioGenerator::Generate(); + // Now write out the DSW this->OutputDSWFile(); } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index cdee3bb82..afe96e718 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -214,33 +214,9 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) void cmGlobalVisualStudio7Generator::Generate() { - // add a special target that depends on ALL projects for easy build - // of one configuration only. - const char* no_working_dir = 0; - std::vector no_depends; - std::map >::iterator it; - for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) - { - std::vector& gen = it->second; - // add the ALL_BUILD to the first local generator of each project - if(gen.size()) - { - gen[0]->GetMakefile()-> - AddUtilityCommand("ALL_BUILD", true, no_depends, - no_working_dir, - "echo", "Build all projects"); - std::string cmake_command = - this->LocalGenerators[0]->GetMakefile()-> - GetRequiredDefinition("CMAKE_COMMAND"); - } - } - - // Fix utility dependencies to avoid linking to libraries. - this->FixUtilityDepends(); - // first do the superclass method - this->cmGlobalGenerator::Generate(); - + this->cmGlobalVisualStudioGenerator::Generate(); + // Now write out the DSW this->OutputSLNFile(); } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 46ce76ea5..c5b291a59 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -30,6 +30,37 @@ cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator() { } +//---------------------------------------------------------------------------- +void cmGlobalVisualStudioGenerator::Generate() +{ + // Add a special target that depends on ALL projects for easy build + // of one configuration only. + const char* no_working_dir = 0; + std::vector no_depends; + cmCustomCommandLines no_commands; + std::map >::iterator it; + for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) + { + std::vector& gen = it->second; + // add the ALL_BUILD to the first local generator of each project + if(gen.size()) + { + // Use no actual command lines so that the target itself is not + // considered always out of date. + gen[0]->GetMakefile()-> + AddUtilityCommand("ALL_BUILD", true, no_working_dir, + no_depends, no_commands, false, + "Build all projects"); + } + } + + // Fix utility dependencies to avoid linking to libraries. + this->FixUtilityDepends(); + + // Run all the local generators. + this->cmGlobalGenerator::Generate(); +} + //---------------------------------------------------------------------------- void cmGlobalVisualStudioGenerator::FixUtilityDepends() { diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 5e08443f4..92acb69ba 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -31,6 +31,11 @@ public: cmGlobalVisualStudioGenerator(); virtual ~cmGlobalVisualStudioGenerator(); + /** + * Basic generate implementation for all VS generators. + */ + virtual void Generate(); + protected: virtual void CreateGUID(const char*) {} virtual void FixUtilityDepends();