diff options
author | Brad King <brad.king@kitware.com> | 2006-08-23 13:45:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-08-23 13:45:24 (GMT) |
commit | f826c6c58bd7dbafee9f0d8d12bb814ac0e8abc5 (patch) | |
tree | 537534219d3e967ed51889f7f493b9ef32ea8d4f /Source | |
parent | 539e5ac4c2c27a49365022d66b228edacc46d24c (diff) | |
download | CMake-f826c6c58bd7dbafee9f0d8d12bb814ac0e8abc5.zip CMake-f826c6c58bd7dbafee9f0d8d12bb814ac0e8abc5.tar.gz CMake-f826c6c58bd7dbafee9f0d8d12bb814ac0e8abc5.tar.bz2 |
ENH: Centralized generation of targets listed in the help to be done by the code that actually writes the targets.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 14 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 11 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 6 |
3 files changed, 20 insertions, 11 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 255b1a3..a647a9c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -1231,15 +1231,13 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule } } } - typedef cmLocalUnixMakefileGenerator3::LocalObjectInfo LocalObjectInfo; - std::map<cmStdString, LocalObjectInfo> const& objs = - lg->GetLocalObjectFiles(); - for(std::map<cmStdString, LocalObjectInfo>::const_iterator o = - objs.begin(); o != objs.end(); ++o) + std::vector<cmStdString> const& localHelp = lg->GetLocalHelp(); + for(std::vector<cmStdString>::const_iterator o = localHelp.begin(); + o != localHelp.end(); ++o) { - path = "... "; - path += o->first; - lg->AppendEcho(commands, path.c_str()); + path = "... "; + path += *o; + lg->AppendEcho(commands, path.c_str()); } } } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 525b791..c082625 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -369,7 +369,7 @@ cmLocalUnixMakefileGenerator3 // Write the rule to the makefile. std::vector<std::string> no_depends; this->WriteMakeRule(ruleFileStream, comment, - output, no_depends, commands, true); + output, no_depends, commands, true, true); } //---------------------------------------------------------------------------- @@ -561,7 +561,8 @@ cmLocalUnixMakefileGenerator3 const char* target, const std::vector<std::string>& depends, const std::vector<std::string>& commands, - bool symbolic) + bool symbolic, + bool in_help) { // Make sure there is a target. if(!target || !*target) @@ -637,6 +638,12 @@ cmLocalUnixMakefileGenerator3 os << "\t" << replace.c_str() << "\n"; } os << "\n"; + + // Add the output to the local help if requested. + if(in_help) + { + this->LocalHelp.push_back(target); + } } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 9bb2ab7..6e0491e 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -73,7 +73,8 @@ public: const char* target, const std::vector<std::string>& depends, const std::vector<std::string>& commands, - bool symbolic); + bool symbolic, + bool in_help = false); // write the main variables used by the makefiles void WriteMakeVariables(std::ostream& makefileStream); @@ -214,6 +215,8 @@ public: std::map<cmStdString, LocalObjectInfo> const& GetLocalObjectFiles() { return this->LocalObjectFiles;} + std::vector<cmStdString> const& GetLocalHelp() { return this->LocalHelp; } + // return info about progress actions unsigned long GetNumberOfProgressActions(); unsigned long GetNumberOfProgressActionsForTarget(const char *); @@ -346,6 +349,7 @@ private: bool SkipAssemblySourceRules; std::map<cmStdString, LocalObjectInfo> LocalObjectFiles; + std::vector<cmStdString> LocalHelp; /* does the work for each target */ std::vector<cmMakefileTargetGenerator *> TargetGenerators; |