find_package查找boost库时的配置参数说明

BoostConfig文件简要说明

boost库的b2使用install命令时会生成BoostConfig.cmake文件,用来提供给find_package函数查找boost库。

BoostConfig文件内说明原文

# This CMake configuration file, installed as part of the Boost build
# and installation procedure done by `b2 install`, provides support
# for find_package(Boost).
#
# It's roughly, but not perfectly, compatible with the behavior
# of find_package(Boost) as provided by FindBoost.cmake.
#
# A typical use might be
#
# find_package(Boost 1.70 REQUIRED COMPONENTS filesystem regex PATHS C:/Boost)
#
# On success, the above invocation would define the targets Boost::headers,
# Boost::filesystem and Boost::regex. Boost::headers represents all
# header-only libraries. An alias, Boost::boost, for Boost::headers is
# provided for compatibility.
#
# Requesting the special component "ALL" will make all installed components
# available, as in the following example:
#
# find_package(Boost 1.73 REQUIRED COMPONENTS ALL)
#
# Since COMPONENTS is optional when REQUIRED is specified, the above can be
# shortened to
#
# find_package(Boost 1.73 REQUIRED ALL)
#
# When ALL is used, a variable Boost_ALL_TARGETS will be set and will contain
# the names of all created targets.
#
# The ALL component cannot be combined with named components.
#
# Since Boost libraries can coexist in many variants - 32/64 bit,
# static/dynamic runtime, debug/release, the following variables can be used
# to control which variant is chosen:
#
# Boost_USE_DEBUG_LIBS:     When OFF, disables debug libraries.
# Boost_USE_RELEASE_LIBS:   When OFF, disables release libraries.
# Boost_USE_MULTITHREADED:  When OFF, uses single-threaded libraries.
#                           The default is multithreaded.
# Boost_USE_STATIC_LIBS:    When ON, uses static Boost libraries; when OFF,
#                           uses shared Boost libraries; when not set, uses
#                           static on Windows, shared otherwise.
# Boost_USE_STATIC_RUNTIME: When ON, uses Boost libraries linked against the
#                           static runtime. The default is shared runtime.
# Boost_USE_DEBUG_RUNTIME:  When ON, uses Boost libraries linked against the
#                           debug runtime. When OFF, against the release
#                           runtime. The default is to use either.
# Boost_COMPILER:           The compiler that has been used to build Boost,
#                           such as vc141, gcc7, clang37. The default is
#                           determined from CMAKE_CXX_COMPILER_ID.
# Boost_PYTHON_VERSION:     The version of Python against which Boost.Python
#                           has been built; only required when more than one
#                           Boost.Python library is present.
#
# The following variables control the verbosity of the output:
#
# Boost_VERBOSE:            Enable verbose output
# Boost_DEBUG:              Enable debug (even more verbose) output

BoostConfig文件内说明机翻说明

# 这个 CMake 配置文件,作为 Boost 构建的一部分安装
# 和通过`b2 install`完成的安装过程,提供支持
# 对于 find_package(Boost)。
#
# 它大致但不完全与行为兼容
FindBoost.cmake 提供的 find_package(Boost) 的数量。
#
# 一个典型的用途可能是
#
# find_package(Boost 1.70 所需组件文件系统正则表达式路径 C:/Boost)
#
# 成功时,上面的调用将定义目标 Boost::headers,
# Boost::filesystem 和 Boost::regex。Boost::headers 代表所有
# 仅标头库。Boost::headers 的别名 Boost::boost 是
# 提供兼容性。
#
# 请求特殊组件“ALL”将使所有已安装的组件
#可用,如下例所示:
#
# find_package(提升 1.73 所需的所有组件)
#
# 由于在指定 REQUIRED 时 COMPONENTS 是可选的,所以上面可以是
# 缩短为
#
# find_package(Boost 1.73 需要全部)
#
# 当使用 ALL 时,变量 Boost_ALL_TARGETS 将被设置并将包含
# 所有创建的目标的名称。
#
# ALL 组件不能与具名组件组合。
#
# 由于 Boost 库可以多种变体共存 - 32/64 位,
# static/dynamic runtime,debug/release,可以使用以下变量
# 控制选择哪个变体:
#
# Boost_USE_DEBUG_LIBS:关闭时,禁用调试库。
# Boost_USE_RELEASE_LIBS:关闭时,禁用发布库。
# Boost_USE_MULTITHREADED:关闭时,使用单线程库。
# 默认是多线程的。
# Boost_USE_STATIC_LIBS:打开时,使用静态 Boost 库;关闭时,
# 使用共享的 Boost 库;未设置时,使用
# 在 Windows 上是静态的,否则是共享的。
# Boost_USE_STATIC_RUNTIME:打开时,使用链接到
# 静态运行时。默认是共享运行时。
# Boost_USE_DEBUG_RUNTIME:打开时,使用链接到
# 调试运行时。OFF时,反释放
# 运行。默认是使用其中一个。
# Boost_COMPILER:已经用于构建Boost的编译器,
# 例如 vc141、gcc7、clang37。默认是
# 根据 CMAKE_CXX_COMPILER_ID 确定。
# Boost_PYTHON_VERSION:Boost.Python 所针对的 Python 版本
# 已经建成;只有当超过一个时才需要
# Boost.Python 库存在。
#
# 以下变量控制输出的详细程度:
#
# Boost_VERBOSE:启用详细输出
# Boost_DEBUG:启用调试(甚至更详细)输出

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值