diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-02-21 19:23:32 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-02-21 19:23:32 (GMT) |
commit | 9cd850c4c798c5018356199b947f4215acbf2f79 (patch) | |
tree | 08bc461fd43a59dcddbe2575198ef20bfe425f43 /Source/QtDialog | |
parent | 06a61c851801c7d56713362d6ef19da6fd5b13dc (diff) | |
download | CMake-9cd850c4c798c5018356199b947f4215acbf2f79.zip CMake-9cd850c4c798c5018356199b947f4215acbf2f79.tar.gz CMake-9cd850c4c798c5018356199b947f4215acbf2f79.tar.bz2 |
BUG: make sure an x server is not required for the build
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index bf78890..17d27c2 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -67,6 +67,42 @@ static const char * cmDocumentationOptions[][3] = int main(int argc, char** argv) { cmSystemTools::FindExecutableDirectory(argv[0]); + // check docs first so that X is not need to get docs + // do docs, if args were given + cmDocumentation doc; + if(doc.CheckOptions(argc, argv)) + { + // Construct and print requested documentation. + cmake hcm; + hcm.AddCMakePaths(); + // just incase the install is bad avoid a seg fault + const char* root = hcm.GetCacheDefinition("CMAKE_ROOT"); + if(root) + { + doc.SetCMakeRoot(root); + } + std::vector<cmDocumentationEntry> commands; + std::vector<cmDocumentationEntry> compatCommands; + std::map<std::string,cmDocumentationSection *> propDocs; + + std::vector<cmDocumentationEntry> generators; + hcm.GetCommandDocumentation(commands, true, false); + hcm.GetCommandDocumentation(compatCommands, false, true); + hcm.GetGeneratorDocumentation(generators); + hcm.GetPropertiesDocumentation(propDocs); + doc.SetName("cmake"); + doc.SetSection("Name",cmDocumentationName); + doc.SetSection("Usage",cmDocumentationUsage); + doc.SetSection("Description",cmDocumentationDescription); + doc.AppendSection("Generators",generators); + doc.PrependSection("Options",cmDocumentationOptions); + doc.SetSection("Commands",commands); + doc.SetSection("Compatilbility Commands", compatCommands); + doc.SetSections(propDocs); + + return (doc.PrintRequestedDocumentation(std::cout)? 0:1); + } + QApplication app(argc, argv); // clean out standard Qt paths for plugins, which we don't use anyway @@ -106,42 +142,6 @@ int main(int argc, char** argv) app.setOrganizationName("Kitware"); app.setWindowIcon(QIcon(":/Icons/CMakeSetup.png")); - // do docs, if args were given - cmDocumentation doc; - if(app.arguments().size() > 1 && - doc.CheckOptions(app.argc(), app.argv())) - { - // Construct and print requested documentation. - cmake hcm; - hcm.AddCMakePaths(); - // just incase the install is bad avoid a seg fault - const char* root = hcm.GetCacheDefinition("CMAKE_ROOT"); - if(root) - { - doc.SetCMakeRoot(root); - } - std::vector<cmDocumentationEntry> commands; - std::vector<cmDocumentationEntry> compatCommands; - std::map<std::string,cmDocumentationSection *> propDocs; - - std::vector<cmDocumentationEntry> generators; - hcm.GetCommandDocumentation(commands, true, false); - hcm.GetCommandDocumentation(compatCommands, false, true); - hcm.GetGeneratorDocumentation(generators); - hcm.GetPropertiesDocumentation(propDocs); - doc.SetName("cmake"); - doc.SetSection("Name",cmDocumentationName); - doc.SetSection("Usage",cmDocumentationUsage); - doc.SetSection("Description",cmDocumentationDescription); - doc.AppendSection("Generators",generators); - doc.PrependSection("Options",cmDocumentationOptions); - doc.SetSection("Commands",commands); - doc.SetSection("Compatilbility Commands", compatCommands); - doc.SetSections(propDocs); - - return (doc.PrintRequestedDocumentation(std::cout)? 0:1); - } - CMakeSetupDialog dialog; QString title = QString("CMake %1"); title = title.arg(cmVersion::GetCMakeVersion().c_str()); |