简体   繁体   English

修改cmake-gui中的变量

[英]Modifying variables in cmake-gui

Here is said that to run cmake for each builds (debug and release) it is recommended to pass CMAKE_BUILD_TYPE as an argument to cmake , eg cmake -DCMAKE_BUILD_TYPE=Release .. or cmake -DCMAKE_BUILD_TYPE=Debug .. What is the equivalent of this in cmake-gui? 这里说为每个构建(调试和发布)运行cmake,建议将CMAKE_BUILD_TYPE作为参数传递给cmake ,例如cmake -DCMAKE_BUILD_TYPE=Release ..cmake -DCMAKE_BUILD_TYPE=Debug ..这相当于cmake的贵? When I press "Configure" then some variables pops-up in window and here I will create new one CMAKE_BUILD_TYPE=Debug and then press "Generate" is this equivalent of above mentioned command line passing? 当我按“配置”然后在窗口弹出一些变量,在这里我将创建一个新的CMAKE_BUILD_TYPE=Debug然后按“生成”这相当于上面提到的命令行传递?

Thanks 谢谢

Yes. 是。 It is equivalent. 它是等价的。

Note that CMAKE_BUILD_TYPE only works for single-configuration generators like Unix Makefiles. 请注意, CMAKE_BUILD_TYPE仅适用于Unix Makefile等单配置生成器。 Generators like Visual Studio generate multi-configuration projects and the choice of the one being compiled is done in the IDE. 像Visual Studio这样的生成器生成多配置项目,并且正在编译的项目的选择在IDE中完成。

EDIT: As stated in comments, and unlike what I suggested below, CMAKE_BUILD_TYPE is not an advanced variable, and effectively needs to be added in the GUI. 编辑:正如评论中所述,与我在下面建议的不同, CMAKE_BUILD_TYPE不是高级变量,实际上需要在GUI中添加。

Not sure, but CMAKE_BUILD_TYPE may already exists as an advanced option: check the "Advanced" checkbox in the GUI to show all the variables. 不确定,但CMAKE_BUILD_TYPE可能已作为高级选项存在:选中GUI中的“高级”复选框以显示所有变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM