cmake的四个命令:add_compile_options、add_definitions、target_compile_definitions、build_command...

cmake的四个命令:add_compile_options、add_definitions、target_compile_definitions、build_command

add_compile_options()

Adds options to the compilation of source files.

增加源文件的编译选项。

add_compile_options(<option> ...)

Adds options to the compiler command line for targets in the current directory and below that are added after this command is invoked. See documentation of the directory and target COMPILE_OPTIONS properties.

为当前路径和下层路径的目标增加编译器命令行选项,选项在此命令被调用后添加。查看文档中关于路径和目标的 COMPILE_OPTIONS 属性。

This command can be used to add any options, but alternative commands exist to add preprocessor definitions (target_compile_definitions() and add_definitions()) or include directories (target_include_directories() and include_directories()).

这个命令可以被用来添加任何的选项,但是存在替代命令(target_compile_definitions() 和 add_definitions())增加预处理定义或(target_include_directories() 和 include_directories())包含路径。

Arguments to add_compile_options may use “generator expressions” with the syntax $<...>. See the cmake-generator-expressions(7) manual for available expressions. See the cmake-buildsystem(7) manual for more on defining buildsystem properties.

add_compile_options的参数可以使用带语法$<...>的“生成表达式”。关于有效的表达式可以查看cmake-generator-expressions(7)手册。关于更多的系统属性的定义可以查看cmake-buildsystem(7)助手。

add_definitions()

Adds -D define

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值