diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-01-30 17:04:38 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-01-30 17:04:38 (GMT) |
commit | 8a83f096371ecc4f73afe43830e94899c704d5cf (patch) | |
tree | e035e45d661fcc35189daafa686484577b502ddc /Source/cmGlobalGenerator.cxx | |
parent | 21e6791789be947c471d0c551e69364e9f475b7e (diff) | |
download | CMake-8a83f096371ecc4f73afe43830e94899c704d5cf.zip CMake-8a83f096371ecc4f73afe43830e94899c704d5cf.tar.gz CMake-8a83f096371ecc4f73afe43830e94899c704d5cf.tar.bz2 |
ENH: fix for bug 3218 dependant projects are written out automatically if they are in the project. Also fix bug 5829, remove hard coded CMAKE_CONFIGURATION_TYPES from vs 7 generator
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dfa6e05..a287ad6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1036,7 +1036,6 @@ int cmGlobalGenerator::Build( std::string makeCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, 0, target, config, false, fast); - if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, &retVal, 0, false, timeout)) { @@ -1291,7 +1290,7 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap() // Add dependencies of the included target. An excluded // target may still be included if it is a dependency of a // non-excluded target. - TargetDependSet const& tgtdeps = this->GetTargetDepends(target); + TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator ti = tgtdeps.begin(); ti != tgtdeps.end(); ++ti) { @@ -1684,7 +1683,7 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*, //---------------------------------------------------------------------------- cmGlobalGenerator::TargetDependSet const& -cmGlobalGenerator::GetTargetDepends(cmTarget const& target) +cmGlobalGenerator::GetTargetDirectDepends(cmTarget const& target) { // Clarify the role of the input target. cmTarget const* depender = ⌖ @@ -1863,6 +1862,62 @@ cmGlobalGenerator std::back_inserter(filenames)); } +void +cmGlobalGenerator +::GetTargetSets(cmGlobalGenerator::TargetDependSet& projectTargets, + cmGlobalGenerator::TargetDependSet& originalTargets, + cmLocalGenerator* root, + std::vector<cmLocalGenerator*> const& generators) +{ + // loop over all local generators + for(std::vector<cmLocalGenerator*>::const_iterator i = generators.begin(); + i != generators.end(); ++i) + { + // check to make sure generator is not excluded + if(this->IsExcluded(root, *i)) + { + continue; + } + cmMakefile* mf = (*i)->GetMakefile(); + // Get the targets in the makefile + cmTargets &tgts = mf->GetTargets(); + // loop over all the targets + for (cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) + { + cmTarget* target = &l->second; + // put the target in the set of original targets + originalTargets.insert(target); + // Get the set of targets that depend on target + this->AddTargetDepends(target, + projectTargets); + } + } +} + +void +cmGlobalGenerator::AddTargetDepends(cmTarget* target, + cmGlobalGenerator::TargetDependSet& + projectTargets) +{ + // add the target itself + projectTargets.insert(target); + // get the direct depends of target + cmGlobalGenerator::TargetDependSet const& tset + = this->GetTargetDirectDepends(*target); + if(tset.size()) + { + // if there are targets that depend on target + // add them and their depends as well + for(cmGlobalGenerator::TargetDependSet::const_iterator i = + tset.begin(); i != tset.end(); ++i) + { + cmTarget* dtarget = const_cast<cmTarget*>(*i); + this->AddTargetDepends(dtarget, projectTargets); + } + } +} + + //---------------------------------------------------------------------------- void cmGlobalGenerator::AddToManifest(const char* config, std::string const& f) @@ -1901,3 +1956,4 @@ cmGlobalGenerator::GetDirectoryContent(std::string const& dir, bool needDisk) } return dc; } + |