diff options
author | Paul Wicking <paul.wicking@qt.io> | 2020-05-18 10:42:25 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-05-26 15:51:19 +0200 |
commit | b80db738944e2c1513a61c1086bb2c27be0c676e (patch) | |
tree | ce95617000a2650c81f15f7ebb347dacecfd7dd5 /src/qdoc/cppcodeparser.cpp | |
parent | 2b0fb3618ff718eec89bbcd155758a719865efef (diff) | |
download | qttools-b80db738944e2c1513a61c1086bb2c27be0c676e.tar.gz |
QDoc: Add CMake package information to documentation
This introduces a new command to QDoc, \qtcmakepackage. The command
works exactly like the \qtvariable command.
The command adds a table row in class and namespace documentation
pages. This entry contains
CMake: find_package(Qt6 COMPONENT Foo)
target_link_libraries(mytarget PUBLIC Qt::Foo)
...immediately preceding the existing "qmake: += Foo" row.
[ChangeLog][qdoc] Added a new QDoc command, \qtcmakepackage, that
adds CMake snippets to class and namespace documentation.
Fixes: QTBUG-84024
Pick-to: 5.15
Change-Id: I687813c76d92f20ec1eac6229ca2c5ef22ca3591
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Thibaut Cuvelier <cuvelier.thibaut@gmail.com>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 2cb6a7820..8b21d56ed 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -628,6 +628,11 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, doc.location().warning( tr("Command '\\%1' is only meaningful in '\\module' and '\\qmlmodule'.") .arg(COMMAND_QTVARIABLE)); + } else if (command == COMMAND_QTCMAKEPACKAGE) { + node->setQtCMakeComponent(arg); + if (!node->isModule()) + doc.location().warning(tr("Command '\\%1' is only meaningful in '\\module'.") + .arg(COMMAND_QTCMAKEPACKAGE)); } else if (command == COMMAND_NOAUTOLIST) { node->setNoAutoList(true); } |