修改cmake-gui中的变量 [英] Modifying variables in cmake-gui
问题描述
这里说,要为每个版本运行cmake(调试和发布)建议将 CMAKE_BUILD_TYPE
作为参数传递给 cmake
,例如 cmake -DCMAKE_BUILD_TYPE = Release ..
或 cmake -DCMAKE_BUILD_TYPE = Debug ..
这相当于在cmake- gui?当我按下配置然后一些变量弹出窗口中,这里我将创建一个 CMAKE_BUILD_TYPE = Debug
然后按生成就是上面提到的命令
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
, e.g. cmake -DCMAKE_BUILD_TYPE=Release ..
or cmake -DCMAKE_BUILD_TYPE=Debug ..
What is the equivalent of this in cmake-gui? 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 仅适用于单配置生成器,如Unix Makefile。
Note that CMAKE_BUILD_TYPE only works for single-configuration generators like Unix Makefiles. Generators like Visual Studio generate multi-configuration projects and the choice of the one being compiled is done in the IDE.
编辑:如上所述,Visual Studio中的生成器生成多配置项目,并且正在编译的生成器的选择在IDE中完成。注释,与下面建议的不同, CMAKE_BUILD_TYPE
不是高级变量,实际上需要在GUI中添加。
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-gui中的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!