QDoc: Implement -installdir CLI option for module cross-linking.
QDoc needs to know the final location of the installed documentation to generate correct relative links between the modules. Normally you can use QLibraryInfo::DocumentationPath for this, but since QDoc gets compiled during Qt bootstrapping QLibraryInfo is not available yet. The -installdir option still allows us to specify QLibraryInfo::DocumentationPath on the command line. Change-Id: Ic4729f4daad112f0d175931467cf09cfcf5145a3 Reviewed-by: Martin Smith <martin.smith@nokia.com>
This commit is contained in:
parent
3de77c3daa
commit
82fcbe9d7d
@ -150,6 +150,7 @@ QStringList MetaStack::getExpanded(const Location& location)
|
||||
QT_STATIC_CONST_IMPL QString Config::dot = QLatin1String(".");
|
||||
bool Config::generateExamples = true;
|
||||
QString Config::overrideOutputDir;
|
||||
QString Config::installDir;
|
||||
QSet<QString> Config::overrideOutputFormats;
|
||||
QMap<QString, QString> Config::extractedDirs;
|
||||
int Config::numInstances;
|
||||
|
@ -111,6 +111,7 @@ public:
|
||||
QT_STATIC_CONST QString dot;
|
||||
|
||||
static bool generateExamples;
|
||||
static QString installDir;
|
||||
static QString overrideOutputDir;
|
||||
static QSet<QString> overrideOutputFormats;
|
||||
|
||||
|
@ -116,10 +116,12 @@ static void printHelp()
|
||||
"Display this information and exit\n"
|
||||
" -highlighting "
|
||||
"Turn on syntax highlighting (makes qdoc run slower)\n"
|
||||
" -no-examples "
|
||||
"Do not generate documentation for examples\n"
|
||||
" -indexdir "
|
||||
"Specify a directory where QDoc should search for indices to link to\n"
|
||||
" -installdir "
|
||||
"Specify the directory where the output will be after running \"make install\"\n"
|
||||
" -no-examples "
|
||||
"Do not generate documentation for examples\n"
|
||||
" -obsoletelinks "
|
||||
"Report links from obsolete items to non-obsolete items\n"
|
||||
" -outputdir "
|
||||
@ -488,6 +490,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
i++;
|
||||
}
|
||||
else if (opt == "-installdir") {
|
||||
Config::installDir = argv[i];
|
||||
i++;
|
||||
}
|
||||
else if (opt == "-obsoletelinks") {
|
||||
obsoleteLinks = true;
|
||||
}
|
||||
|
@ -967,7 +967,18 @@ void Tree::readIndexFile(const QString& path)
|
||||
file.close();
|
||||
|
||||
QDomElement indexElement = document.documentElement();
|
||||
QString indexUrl = indexElement.attribute("url", "");
|
||||
|
||||
// Generate a relative URL between the install dir and the index file
|
||||
// when the -installdir command line option is set.
|
||||
QString indexUrl;
|
||||
if (Config::installDir.isEmpty()) {
|
||||
indexUrl = indexElement.attribute("url", "");
|
||||
}
|
||||
else {
|
||||
QDir installDir(Config::installDir);
|
||||
indexUrl = installDir.relativeFilePath(path).section('/', 0, -2);
|
||||
}
|
||||
|
||||
priv->basesList.clear();
|
||||
priv->relatedList.clear();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user