CMake2-变量4-常用内置变量2:CMAKE_BINARY_DIR【构建树的顶层路径】、CMAKE_CURRENT_BINARY_DIR【当前正在处理的二进制目录的路径】

一、CMAKE_BINARY_DIR

The path to the top level of the build tree.

This is the full path to the top level of the current CMake build tree. For an in-source build, this would be the same as CMAKE_SOURCE_DIR.

When run in cmake -P script mode, CMake sets the variables CMAKE_BINARY_DIRCMAKE_SOURCE_DIRCMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR to the current working directory.

二、CMAKE_CURRENT_BINARY_DIR

The path to the binary directory currently being processed.

This is the full path to the build directory that is currently being processed by cmake. Each directory added by add_subdirectory() will create a binary directory in the build tree, and as it is being processed this variable will be set. For in-source builds this is the current source directory being processed.

When run in cmake -P script mode, CMake sets the variables CMAKE_BINARY_DIRCMAKE_SOURCE_DIRCMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR to the current working directory.




CMAKE_BINARY_DIR — CMake 3.27.9 Documentation

CMAKE_CURRENT_BINARY_DIR — CMake 3.27.9 Documentation 

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值