Modifying variables in cmake-gui

天涯浪子 提交于 2019-12-11 08:38:25

问题


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?

Thanks


回答1:


Yes. It is equivalent.

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.

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.

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.



来源:https://stackoverflow.com/questions/39401026/modifying-variables-in-cmake-gui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!