From b80db738944e2c1513a61c1086bb2c27be0c676e Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 18 May 2020 10:42:25 +0200 Subject: QDoc: Add CMake package information to documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ƶ Reviewed-by: Thibaut Cuvelier --- src/qdoc/cppcodeparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qdoc/cppcodeparser.cpp') 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); } -- cgit v1.2.1