cmake / CMAKE _ * _ OUTPUT_DIRECTORY 说明

一、CMAKE_LIBRARY_OUTPUT_DIRECTORY

Where to put all the LIBRARY targets when built.

This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

说人话就是指定动态库或者静态库的输出目录。

栗子

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)

二、CMAKE_ARCHIVE_OUTPUT_DIRECTORY

Where to put all the ARCHIVE targets when built.

This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

暂时没用过。

三、CMAKE_RUNTIME_OUTPUT_DIRECTORY

Where to put all the RUNTIME targets when built.

This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

说人话就是指定可执行文件的输出目录。

栗子

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Bin)

三者一般都是在根 CMakeLists 中使用,如果子目录中没有指定输出位置,则沿用父目录指定的输出位置。

(SAW:Game Over!)

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值