在`findxxx.cmake`中读取CMAKE软件包描述的正确方法是什么?
当用不熟悉的软件包对抗时,我需要阅读 findxxx.cmake
以找出预定义的缓存变量。例如,在 findboost.cmake
中,起始行是这样的:
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindBoost
---------
Find Boost include dirs and libraries
Use this module by invoking :command:`find_package` with the form:
.. code-block:: cmake
find_package(Boost
[version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
[REQUIRED] # Fail with error if Boost is not found
[COMPONENTS <libs>...] # Boost libraries by their canonical name
# e.g. "date_time" for "libboost_date_time"
[OPTIONAL_COMPONENTS <libs>...]
# Optional Boost libraries by their canonical name)
) # e.g. "date_time" for "libboost_date_time"
描述是用 .rst
编写的,但是我不知道读取它的正确方法是什么除了使用VIM打开它。
我理想的阅读方式是使用命令行,例如 cmake-show-show-module boost
,然后弹出了一个观众。或使用vscode,悬停 find_package(boost)
,然后弹出描述。我该如何实现?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Cmake的
查找&lt; module&gt;
文件以重组文本(RST)格式包含其文档。 Findboost 模块地址https://cmake.org/cmake/help/latest/module/findboost.html
。要从命令行中查看文档,您可以
用于其他cmake查找模块替换
boost
用适当的模块名称,例如qt
。CMake's
Find<module>
files contain their documentation in reStructuredText (rst) format. The online documentation is generated from this data and can be easily viewed with a browser, e.g. using for theFindBoost
module the addresshttps://cmake.org/cmake/help/latest/module/FindBoost.html
.To view the documentation from the command line you can use
For other CMake find modules replace
Boost
with the appropriate module name, for instanceQt
.