summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-01-09 21:59:01 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-01-09 21:59:01 (GMT)
commitacb27977f0d7e5ff38d3deede9d132ec5da12e42 (patch)
treebb574029672dda8e83f723202f80c3c475c6aec2 /Source/cmDocumentation.cxx
parentb761da39c14c9f003d9113418aca9370f30a5e6e (diff)
downloadCMake-acb27977f0d7e5ff38d3deede9d132ec5da12e42.zip
CMake-acb27977f0d7e5ff38d3deede9d132ec5da12e42.tar.gz
CMake-acb27977f0d7e5ff38d3deede9d132ec5da12e42.tar.bz2
ENH: sort the module files alphabetically when generating the documentation
of rht modules Alex
Diffstat (limited to 'Source/cmDocumentation.cxx')
-rw-r--r--Source/cmDocumentation.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 8affbe3..7fbdfda 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -445,14 +445,23 @@ void cmDocumentation
::CreateModuleDocsForDir(cmsys::Directory& dir,
cmDocumentationSection &moduleSection)
{
+ // sort the files alphabetically, so the docs for one module are easier
+ // to find than if they are in random order
+ std::vector<std::string> sortedFiles;
for(unsigned int i = 0; i < dir.GetNumberOfFiles(); ++i)
+ {
+ sortedFiles.push_back(dir.GetFile(i));
+ }
+ std::sort(sortedFiles.begin(), sortedFiles.end());
+
+ for(std::vector<std::string>::const_iterator fname = sortedFiles.begin();
+ fname!=sortedFiles.end(); ++fname)
{
- std::string fname = dir.GetFile(i);
- if(fname.length() > 6)
+ if(fname->length() > 6)
{
- if(fname.substr(fname.length()-6, 6) == ".cmake")
+ if(fname->substr(fname->length()-6, 6) == ".cmake")
{
- std::string moduleName = fname.substr(0, fname.length()-6);
+ std::string moduleName = fname->substr(0, fname->length()-6);
// this check is to avoid creating documentation for the modules with
// the same name in multiple directories of CMAKE_MODULE_PATH
if (this->ModulesFound.find(moduleName) == this->ModulesFound.end())
@@ -460,7 +469,7 @@ void cmDocumentation
this->ModulesFound.insert(moduleName);
std::string path = dir.GetPath();
path += "/";
- path += fname;
+ path += (*fname);
this->CreateSingleModule(path.c_str(), moduleName.c_str(),
moduleSection);
}