qt - 从 CMake 生成 qt 帮助文件
问题描述
我想使用qt 帮助框架为我的程序创建在线帮助。我的 doc 文件是由 doxygen 生成的,我想从中生成 qt 帮助生成器的文件。
我的程序是用 CMake 构建的,并且我添加了一个用于生成文档的目标:
cmake_minimum_required (VERSION 3.21.0)
find_package(Doxygen REQUIRED dot)
set (DOXYGEN_HIDDEN_SYMBOLS "")
if (DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
doxygen_add_docs(
myprograme-manual
${CMAKE_CURRENT_SOURCE_DIR}/en
)
endif(DOXYGEN_FOUND)
之所以configure_file
需要,是因为在配置中我使用了 CMake 变量,例如我的程序版本等。
这是我创建 qhp 文件的 doxyfile 的一部分。
GENERATE_QHP = YES
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
# the HTML output folder.
# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE = @DOC_OUTPUT_DIRECTORY@/manual.qch
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = my.program
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
# The QHG_LOCATION tag can be used to specify the location (absolute path
# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
# run qhelpgenerator on the generated .qhp file.
# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
问题是没有生成文件。从评论中我可以看到我需要定义QHG_LOCATION
参数,这是qhelpgenerator
. 由于我使用CMake,计算机上的qt路径不固定,我使用find_package
它是为了使用Qt。如何从find_package(Qt)
允许我定义 qhelpgenerator 位置的变量中定义一个变量?
解决方案
推荐阅读
- jquery - jQuery-Form-Validator - 域验证
- apache-kafka - kafka 从 Snowflake 将部分数据加载到主题中
- python - 来自outlook的python最新电子邮件接收日期
- flutter - 颤振多行显示与卡中的填充?
- postman - 邮递员为 pm.sendRequest 提供 400
- html - 如何在 CSS 中将列表的点向上移动一点?
- java - Java使用分隔符拆分字符串并存储到不同的数组
- javascript - 我无法在 jQuery 中更改 html 的文本
- laravel - laravel 本地化不适用于参数
- html - 无法在对角分割的 html 页面中显示图像。请检查代码并让我知道问题