cmake设置默认CMAKE_BUILD_TYPE

原文:https://cmake.org/pipermail/cmake/2009-June/030311.html

CMakeLists.txt里写入

IF (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "Release" CACHE STRING
        "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF()
posted @ 2024-09-28 13:05  寻找繁星  阅读(15)  评论(0编辑  收藏  举报