CMAKE 3.3.2: Set build type in CMakeLists.txt

廉价感情. 提交于 2020-06-26 06:08:13

问题


Is there a way to set the build type from CMakeLists.txt? So that with (or without) generating a new makefile when I compile it should go with the release mode. I try something along the lines of:

set(DCMAKE_BUILD_TYPE "Release")

But it doesn't work (compiles in debug mode). This is on a linux system. Thanks.


回答1:


It's simply:

set(CMAKE_BUILD_TYPE "Release")


来源:https://stackoverflow.com/questions/34558795/cmake-3-3-2-set-build-type-in-cmakelists-txt

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