FindQtDocs CMake module
I'm currently shitfing some common CMake code from various disparate projects to common shared CMake modules. The first of these is some code for locating Qt's documentation tag files for linking Doxygen-based documentation to Qt's documentation. The resutling FindQtDocs module is now availble on GitHub here.
The module works by using either Qt's qtpaths
(from Qt 6.2.0 onwards) or qmake
(before Qt 6.2.0) to fetch Qt's
QT_INSTALL_DOCS
property1. Once the QT_INSTALL_DOCS
path is known, the module simply looks for the requires Qt
modules' *.tags
files, setting the relevant CMake variables following the usual find_package
conventions, such as:
find_package(QtDocs COMPONENTS Core Bluetooth)
if (QtDocs_FOUND)
message(DEBUG "Do things with ${QtDocs_Core_TAGS} and ${QtDocs_Bluetooth_TAGS}")
endif()
Footnotes
-
Support for the
-query
option was added toqtpaths
in Qt 6.2.0. It works the same asqmake
's-query
, but presumably was added to assist the gradual removal ofqmake
, sinceCMake
is now Qt's preferred build system. ↩