summaryrefslogtreecommitdiff
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-09-19 13:14:25 -0400
committerAlexander Neundorf <neundorf@kde.org>2007-09-19 13:14:25 -0400
commit31881265c7651af289e1ebbe20946ae78f067222 (patch)
tree59abed1f6fcf0314a7999e0da9e268384e7a7e55 /Source/cmakemain.cxx
parenta581b643307a7cdc98889b40d35cc09f1806aace (diff)
downloadcmake-31881265c7651af289e1ebbe20946ae78f067222.tar.gz
ENH: add new help option --help-custom-modules, which generates
documentation for all modules found in CMAKE_MODULE_PATH, which currently has to be specified via -D, this can later on be improved e.g. by reading a special (to-be-created) file like CMakeFiles/ModulePath.cmake in the build tree so that running cmake help in the build tree of a project will always give you the current module path. (This could actually also help IDEs which would like to support cmake for projects...) Alex
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 5413013d1a..0717cf50a0 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -138,6 +138,12 @@ static const cmDocumentationEntry cmDocumentationOptions[] =
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML and plain text."},
+ {"--help-custom-modules [file]" , "Print help for all custom modules and "
+ "exit.",
+ "Full documentation for all custom modules is displayed. "
+ "If a file is specified, the documentation is written into and the output "
+ "format is determined depending on the filename suffix. Supported are man "
+ "page, HTML and plain text."},
{"--help-property prop [file]",
"Print help for a single property and exit.",
"Full documentation specific to the given module is displayed."
@@ -277,6 +283,21 @@ int do_cmake(int ac, char** av)
cmake hcm;
hcm.AddCMakePaths(av[0]);
doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
+
+ // the command line args are processed here so that you can do
+ // -DCMAKE_MODULE_PATH=/some/path and have this value accessible here
+ std::vector<std::string> args;
+ for(int i =0; i < ac; ++i)
+ {
+ args.push_back(av[i]);
+ }
+ hcm.SetCacheArgs(args);
+ const char* modulePath = hcm.GetCacheDefinition("CMAKE_MODULE_PATH");
+ if (modulePath)
+ {
+ doc.SetCMakeModulePath(modulePath);
+ }
+
std::vector<cmDocumentationEntry> commands;
std::vector<cmDocumentationEntry> compatCommands;
std::vector<cmDocumentationEntry> globalProperties;